perm filename ALLDAT.17D[J17,SYS] blob sn#111576 filedate 1974-07-13 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00040 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00005 00002	DATA AREA FOR SAUNDERS DISK SERVICE - JAM 10-20-69
C00009 00003	BEGIN DSKDAT
C00014 00004	DSKDDB: THE DUMMY DEVICE DATA BLOCK IS THE FIRST ONE IN THE CHAIN.
C00018 00005	↑HA:	0
C00022 00006	↑D2INT:	0				JSR HERE FROM 144
C00024 00007	MORE DATA FOR D2CHN
C00025 00008	BEGIN DPYDAT
C00027 00009	   NOW THE DPY PROGRAM HEADERS.  
C00035 00010	↑STRTBL:BLOCK DPYNUM	THIS TABLE, INDEXED BY DISPLAY NO.,
C00038 00011	 DATA DISK DATA STORAGE
C00045 00012	BEGIN DTCDDB
C00047 00013	UNIT←DTCNUM-1
C00048 00014	TEMPORARY STORAGE FOR DECTAPE SERVICE
C00051 00015	IFN FTDISK,<
C00053 00016	BEGIN LPTDDB
C00055 00017	BEGIN XGPDDB	↔ SUBTTL DATA STORAGE FOR XGP SERVICE
C00063 00018	BEGIN PTRDDB -- PAPER TAPE READER DEVICE DATA BLOCK
C00064 00019	BEGIN PTPDDB -- PAPER TAPE PUNCH DEVICE DATA BLOCK
C00068 00020	BEGIN SCNDDB
C00071 00021	FOLLOWING ARE DEFINITIONS OF THE RELATIVE BUFFER PARAMETER WORDS:
C00074 00022	SCANNER DEVICE DATA BLOCK.
C00077 00023	↑LINSAV: 0
C00078 00024	DIALER DATA AREA
C00079 00025	BEGIN MTCDDB  --  DEVICE DATA BLOCK FOR MAG TAPES.
C00080 00026		UNIT←MTCNUM-1
C00082 00027	BEGIN SPWDAT -- DATA FOR SPACEWAR
C00083 00028	SCHEDULER DATA AREA . . .
C00087 00029	SHARABLE DEVICE REQUEST TABLE(GENERALIZED FOR OTHER QUEUES TOO)
C00089 00030	DATA AREA FOR CORE MANAGEMENT SYSTEM
C00091 00031	FREE STORAGE PARAMETERS
C00094 00032	SPARE LIST CONTROL BLOCKS
C00096 00033	BEGIN TVDDB -- TV CAMERA DEVICE DATA BLOCK
C00097 00034	IFN ELFNUM <SUBTTL ELFDDB - PDP-11 BARE MACHINE MODE
C00098 00035	BEGIN ADDDB -- DEVICE DATA BLOCK FOR A/D AND D/A.
C00100 00036	BEGIN ADCDDB - NEW AD/DA CONVERTER - (JAM 2-5-74)
C00103 00037	BEGIN APRDAT	↔	SUBTTL	APRDAT 7 NOV 68	APRSER DATA
C00112 00038	↑SYSBEG←←.		HERE TO SYSEND ZEROED AT RELOAD OR INITIALIZATION
C00123 00039		DATA AREA FOR PARITY SERVICE
C00125 00040	 STATISTICS COUNTERS
C00131 ENDMK
C⊗;
SUBTTL DATA AREA FOR SAUNDERS DISK SERVICE - JAM 10-20-69
;TEMP STORAGE &C. FOR DSKSER

↓DSKADR←←14B18		;3330 DEVICE ADDRESS
↓TRKCYL←←=19		;TRACKS PER CYLINDER
↓SNSLEN←←=24		;NUMBER OF SENSE BYTES
↓BKPTRK←←1		;1 BLOCK PER TRACK FOR NOW
↓RCPBLK←←22		;NUMBER OF RECORDS PER BLOCK
↓FPACKS←←3		;NUMBER OF FILE SYSTEM PACKS;
↓UPACKS←←3		;NUMBER OF USER DISK PACKS
↓NPACKS←←FPACKS+UPACKS	;NUMBER OF PACKS (INCLUDING SWAPPING/UDP PACK)

↓SECSIZ←←40		;WORDS/DISK SECTOR
↓RECSIZ←←200		;RECORD SIZE
↓RECWSH←←7		;RECSIZ LOG 2
↓CRMAX←←RCPBLK+1	;TOTAL RECORDS PER BLOCK (INCLUDING RETRIEVAL)
↓BKPGRP←←2*20		;16 WORDS OF HALFWORD PTRS.
↓BKDSIZ←←RECSIZ*RCPBLK	;BLOCK DATA AREA SIZE
↓BLKWDS←←BKDSIZ+SECSIZ	;TOTAL BLOCK SIZE (INCLUDING RTVL).
↓RCPGRP←←RCPBLK*BKPGRP	;RECORDS/GROUP.
↓RCPTRK←←BKPTRK*CRMAX	;NUMBER OF RECORDS PER TRACK INCL. RETRIEVAL


↓NSATBK←←1		;NUMBER OF BLOCKS NEEDED FOR SAT TABLE.

;PACKAD IS A TABLE THAT CONTAINS THE LAST LEGAL PHYSICAL TRACK NUMBER FOR
;ANY GIVEN DISK PACK.
	-1		;FOR REFERENCE TO PACKAD-1
PACKAD:
RADIX =10
ZZZ←←0			;PACK NUMBER
TTRK←←0			;TOTAL TRACKS SO FAR
FOR @' I IN (800,800,800,800,400,400) <
CAT(↓NCYL,\ZZZ)←←I			;NUMBER OF CYLINDERS FOR THIS PACK
CAT(↓NTRK,\ZZZ)←←I*TRKCYL		;NUMBER OF TRACKS FOR THIS PACK
CAT(↓TTRK,\ZZZ)←←TTRK←←TTRK+I*TRKCYL	;TOTAL TRACKS
ZZZ←←ZZZ+1
	TTRK-1				;LAST LEGAL TRACK IN THIS PACK
>
IFN .-PACKAD-NPACKS,<
	.FATAL NPACKS ≠ NUMBER OF PACKS AT PACKAD
>

↓NXTRA0←←11		;NUMBER OF EXTRA CYLINDERS ON PACK 0

RADIX 8

↓LSTBIT←←CAT(TTRK,\<FPACKS-1>)-NSATBK	;LAST LOGICAL TRACK # IN FILE SYS (NOT UDP)
↓SATWCT←←(((LSTBIT/44)+=10)/=10)*=10	;NUMBER OF WORDS IN SAT BIT-TABLE
			;CONTRIVED TO A MULTIPLE OF =10 FOR SOME UNKNOWABLE PURPOSE
↓LSTADR←←TTRK-NSATBK	;LAST LOGICAL TRACK NUMBER (INCLUDING UDP)
↓LSTTRK←←TTRK-1		;LAST LEGAL PHYSICAL TRACK NUMBER (INCLUDING UDP)

;NCYLSH IS A TABLE CONTAINING THE NUMBER OF CYLINDERS FOR EACH PACK
;EACH ENTRY IS SHIFTED LEFT 4 BITS.  USED AT READDN IN HPIC
↓NCYLSH:	
FOR @' I ← 0,NPACKS-1 <
	NCYL'I⊗4
>


BEGIN DSKDAT

↑BADMAX←←=46			;MAX NO. OF BAD TRACKS.
↑QQSIZ←←30			;NEED NOT BE > NUMBER OF DDB'S.
↑QBEGIN:	BLOCK QQSIZ	;INTERRUPT SUBR REQUEST QUEUE
↑QEND:	0
↑LBEGIN:	BLOCK QQSIZ	;LOG OF I-SUBR CALLS FOR DEBUGGING
↑LOGEND:	0
↑MIPTR:	0
↑MOPTR:	0
↑UPTR:	0			;UDP I-SUBR REQUEST CELL
↑DFBUSY:	0		;FLAG TO INDICATE I-SUBR ACTIVITY.
↑DQCNT:	0			;NUMBER OF LOSERS CURRENTLY IN DISK QUEUE

↑TFRRTN:	0		;WHERE IN I-SUBR TO RTN TO WHEN XFER DONE
↑INTRTN:	0		;WHERE TO GO TO DISMISS INTERRUPT
	GLOBAL CH6SAC
↑UUOACS←←CH6SAC

↑DSKACS:	BLOCK 20	;I-LEVEL AC'S SAVED HERE BETWEEN INT'S
↑DSKPDL:	BLOCK 50	;PRIVATE PDL FOR DSKSER CH6 OPS

↑DSKSV:	0
	MOVEM 17,UUOACS+17
	MOVEI 17,UUOACS
	BLT 17,UUOACS+16	;SAVE USER'S ACS IN COMMON CH6 AREA.
	MOVE 3,[XWD -50,DSKPDL-1]
	PUSHJ 3,@DSKSV		;SERVICE INTERRUPT.
	MOVSI 17,UUOACS		;RETURN HERE TO DISMISS;
	BLT 17,17		;RESTORE USER'S AC'S.
	JEN @DSKCHL

↑DSKEDD:	0		;ERROR VERSION OF ABOVE
↑ACDDB:	0			;LAST DDB FOR BAD AUDIT
↑SWPDDB:	0		;UDP DDB FOR SWAPPING
↑ERRBIT:	0		;ERROR BITS FOR LAST XFER
↑DSKERB:	0		;ERROR BITS (LH=IOP, RH=DISC)
↑DSKJB:	0
↑DSKMA:	0
↑DXB:	0			;CURRENT DDB
↑DXC:	0			;CURRENT TFRCTL
↑DXJ:	0			;JOB NUMBER
↑DXP:	0			;LAST STACK PTR
↑DXS:	0			;CURRENT TFRSEC
↑DXW:	0			;CURRENT TFRIOW

↑SYSBUF:	BLOCK SECSIZ	;RETRIEVAL PART OF SYSTEM BUFFER
↑SYSDTA:	BLOCK BKDSIZ	;DATA PART
↑QBUF:		BLOCK SECSIZ
↑BKIN:	0			;PRESENT OCCUPANT OF SYSBUF
↑DFTEMP:	0		;SCRATCH CELL.

↑SATFLG:	0		;INDICATES CHANGE, WRITEOUT RQD
↑SATMOD:	-1		;I/O DIRECTION. USED BY ACISAT ETC.
				;-1:READ    0:WRITE	THE SAT TABLE.

;SAT TABLE AS STORED ON BLOCK 0 OF THE DISK
	DEFINE ZWD (A)<↑A←←.-SATTAB ↔ 0 >
	DEFINE ZLOC (A)<↑A←←.-SATTAB>

↑SATTAB:			;THIS IS SAT BIT AREA AS STORED ON DISK.
	ZWD(DSKUSE)		;BLOCKS USED ON DISK
	ZWD(LSTBLK)		;NUMBER OF LAST BLOCK ASSIGNED
	ZWD(SATID)		;IDENT.NO. OF ALL DISK INFO
	ZWD(SATCHK)		;XOR CHECKSUM OF SAT BITS BELOW
	ZWD(BADCNT)		;NO. OF BAD TRACKS IN TABLE BELOW.
	ZWD(BADCHK)		;CHECK (SUM) OF TABLE.
	ZLOC(BADTRK)
	BLOCK BADMAX		;TABLE OF BAD LOGICAL BLOCK NUMBERS (TRACKS)
	ZWD(DTIME)		;TIME SAT LAST WRITTEN
	ZWD(DDATE)		;DATE SAT LAST WRITTEN
↑P1OFF:		0		;# PDP-10 POWER FAILURES	(MAIN SAT ONLY!)
↑P2OFF:		0		;# OF PDP-6 POWER FAILURES	(MAIN SAT ONLY)
		0		;BUFFER WORD.			(NOT NEEDED)
	ZLOC(SATBIT)		;LOCATION OF THE BIT TABLE ITSELF
	BLOCK SATWCT	
↑SATEND:	0		;END OF MAIN BIT TABLE (UDP SATS ARE DIFFERENT SIZE)
↑SATSIZ←←SATEND-SATTAB

IFG SATSIZ-BLKWDS*NSATBK,<
.FATAL	SAT TOO BIG FOR THE DISK SPACE ALLOCATED. INCREASE NSATBK AND PRAY
>
;DSKDDB: THE DUMMY DEVICE DATA BLOCK IS THE FIRST ONE IN THE CHAIN.

	DEFINE ZWD' (A)<
	↑A←←.-DSKDDB
;	INTERNAL A
	0	>

	DEFINE ZLOC' (A)<
	↑A←←.-DSKDDB
;	INTERNAL A	>

;	INTERNAL DSKDDB
REPEAT DDBSKW-1,<0>
	DEVAOA!DEVSHR,,0	;EXTRA WORD FOR MORE GOOD BITS
↑DSKDDB:SIXBIT /DSK/		;DEVNAM
	XWD =60*HUNGST,201	;DEVCHR
	0			;DEVIOS
	XWD UDP0DD,DSKDSP	;DEVSER. NEXT DDB IS UDP.
	XWD DVOUT+DVIN+DVDIR+DVDSK+DVLNG,154403	;DEVMOD
	0			;DEVLOG
	0			;DEVBUF
	XWD PROG,0		;DEVIAD
	XWD PROG,0		;DEVOAD

	;NEXT 8 LOCATIONS COPIED FOR AUDITOR
	ZWD FILNAM
	ZWD FILEXT
	ZWD FILPRO
	ZWD FILPPN
	ZWD FILLOC
	ZWD FILLNG
	ZWD REFTIM
	ZWD DMPTIM

	ZWD USETP
	ZWD UFDPRO		;PROTECTION OF THE UFD FROM WHICH FILE CAME
	ZWD UFDPR1		;TEMP COPY OF ABOVE WHILE DOING RENAME
				;ALSO, RH← LH(DQINFO+3) OF UFD LAST ACCESSED

	ZWD ACCNAM
	ZWD ACCEXT
	ZWD ACCPRO
	ZWD ACCPPN

	ZWD SRCNAM
	ZWD SRCEXT
	ZWD SRCPRO
	ZWD SRCLOC
	ZWD SRCTMP
	ZWD DMPBUF

	ZWD TFRSEC
	ZWD TFRIOW
	ZWD TFRCTL

	ZWD DSKFAD
	ZWD DSKLAD
	ZWD CORFAD
	ZWD CORLAD

	ZLOC DSKDAT;	BEGIN GRP-DEPENDENT PART OF DDB
	ZWD DDNAM
	ZWD DDEXT
	ZWD DDPRO
	ZWD DDPPN
	ZWD DDLOC
	ZWD DDLNG
	ZWD DREFTM
	ZWD DDMPTM
	ZWD DGRP1R;	FIRST USER RCRD NO. THIS GRP
	ZWD DNXTGP;	BLOCK NUMBER OF NEXT GROUP
	ZWD DSATID
	ZWD DQINFO	;START OF SPECIAL STORAGE FOR LOGIN ETC.
	BLOCK 17+DSKDDB+DSKDAT-.
↑↑DQLEN←←.-DSKDDB-DQINFO
	ZWD DOFFST	;RECORD OFFSET
	ZLOC DPTR;	RETRIEVAL DATA,
	BLOCK 20	;2 BLK NO.'S/WORD
	ZLOC DDEND
↑DDBSIZ←←.-DSKDDB+DDBSKW

FOR @$ UNUM←0,UPACKS-1
{REPEAT DDBSKW-1,<0>
	DEVAOA!DEVLUP,,0
↑UDP$UNUM$DD:
	SIXBIT /UDP$UNUM/
	XWD =30*HUNGST,UNUM⊗PUNITP
	0			
IFN UNUM-UPACKS+1,<
	CAT(CAT(UDP,\<UNUM+1>),DD),,UDPDSP	
;>	PTRDDB,,UDPDSP
	XWD DVUDP!DVOUT!DVIN!DVDIR!DVLNG,100000	
	0			
	0			
	XWD PROG,0		
	XWD PROG,0		
	
	BLOCK <DDBSIZ-UDP$UNUM$DD+.>		;MAKE SAME SIZE AS DSKDDB.
↑UDPOFF←←.-UDP$UNUM$DD
	CAT(TTRK,\<FPACKS+UNUM-1>)		;OFFSET TO FIRST BLOCK OF THIS UDP
}

↑SYSRTV←←SYSBUF-DSKDAT	;FOR REFERRING TO DDXXX IN SYSBUF
↑HA:	0
	0
	0

;HERE ARE VARIOUS PIECES OF DATA.

↑PMPCNI:	0
↑DSKLRN:	0		;LOGICAL DISK ADDRESS FOR THIS XFER.

↑DSKHNG:	0		;DISK HUNG COUNTING CELL, COUNTED DOWN BY DEVCHK
↑DHNGST:	0		;DSKHNG SET FROM HERE ON EACH DSK INTERRUPT
↑DRAUFO:	0
↑DSKOPS:	BLOCK	JOBN	;NUMBER OF DISK OPERATIONS FOR EACH JOB
↑DSKOVC:	0
↑STAC:		0
↑STAC1:		0
↑SAC3:		0
↑SDAT:		0
↑SAVP:		0
↑INTPDL:	0


↑SKCMD:		36007!DSKADR	;SEEK COMMAND.
↑SKWCMA:	SKDAT
↑SCCMD:		36461!DSKADR	;SEARCH COMMAND,WITH CHAIN & SKIP IF OFF
↑SCWCMA:	SCDAT

;FOLLOWING MUST BE IN ORDER:

↑RCMD:	22006!DSKADR		;READ COMMAND
↑WCMD:	22005!DSKADR		;WRITE COMMAND
	16555!DSKADR	;"USE" MODE. SRCH KEY/DATA EQ-HI.
	16455!DSKADR	;"OWN" MODE. SRCH KEY/DATA EQ.

;NEXT 2 LOCS ARE A TABLE!
		SKIPL TAC		;READ END TEST
↑ENDTAB:	CAML TAC,[-1,,0]	;WRITE END TEST

↑SNSCMD:	34004!DSKADR	;SENSE COMMAND.(4 BYTE MODE)
↑SNWCMA:	SNSDAT
↑SNSDAT:	BLOCK SNSLEN/4	;SENSE PUTS DATA HERE.(4 BYTES PER WORD)
		0
↑RCALCM:	23!DSKADR	;RECALIBRATE THE SEEK HYDRAULICS.
↑RDHACM:	34032!DSKADR	;READ HOME ADDRESS.(4 BYTE MODE)
↑NOPCMD:	3!DSKADR	;NO-OP COMMAND

;COMMANDS FOR DIAGNOSTIC LOAD AND WRITE

↑DWCMD:		36163!DSKADR	;DIAGNOSTIC WRITE
↑MSKCMD:	22037!DSKADR	;SET FILE MASK
↑DLCMD:		36123!DSKADR	;DIAGNOSTIC LOAD
↑RD1CMD:	34104!DSKADR	;READ DIAGNOSTIC STATUS 1

↑FILMSK:	BYTE(8)4	;PERMIT DIAGNOSTIC WRITE COMMAND


;COLLECT ERROR COUNTS HERE
↑ERRCL0:	0
↑ERRCL1:	0
↑ERRCL2:	0
↑ERRCL3:	0
↑ERRCL4:	0
↑ERRSNS:	0
↑ERRHA:		0
↑ERRRCL:	0
↑SHADPE:	0

;THESE ARE THE HARD ERROR MAXIMUMS!
↑MAXCL0:	100
↑MAXCL1:	100
↑MAXCL2:	100
↑MAXCL3:	100
↑MAXCL4:	100
↑MAXSNS:	10
↑MAXHA:		10
↑MAXRCL:	10

;THESE ARE THE MASKS FOR WHEN TO PRINT AN ERROR CLASS
;THEY MUST BE -2**N-1 FOR TDNE
↑TYMSK0:	¬10
↑TYMSK1:	¬10
↑TYMSK2:	¬10
↑TYMSK3:	¬10
↑TYMSK4:	¬20

;COLLECT TOTAL COUNTS HERE
↑TOTCL0:	0
↑TOTCL1:	0
↑TOTCL2:	0
↑TOTCL3:	0
↑TOTCL4:	0

;SET THESE FLAGS TO FORCE TYPEOUT OF EVERY ERROR
↑TYPCL0:	0
↑TYPCL1:	0
↑TYPCL2:	0
↑TYPCL3:	0
↑TYPCL4:	0

↑DSKACT:	0	;FLAG DISK CHANNEL ACTIVE

↑DEATH:		0	;ERROR ROUTINE HAS DECREED DEATH TO THE INFIDEL'S

↑TYPANY:	0
↑SNSTYP:	0
↑CSTOP:		0
↑ERRCMD:	0
↑CNISAV:	0
↑XDSKMA:	0

↑HNGFLG:	0
↑CT:		0
↑LCT:		0
↑WCT:		0
↑HAFLAG:	0
↑DSKFLG:	0
↑D2INT:	0				;JSR HERE FROM 144
	MOVEM TAC,TSAV
	CONI PMP,TAC			;GET STATUS
	TRNN TAC,NEWST!UNEND		;NEW STATUS OR UNUSUAL END?
	JRST ITEST			;NO.  PERHAPS CHDEMP
	XOR TAC,TSTXOR
	TDNN TAC,TSTBIT			;SKIP IF LOSING.
	TRNN TAC,DEVEND!CHNEND		;ONE OF THESE OUGHT TO BE ON IF NEW STATUS
	JRST D2XE			;SOMETHING EVIL THIS WAY COMES.
	XOR TAC,TSTXOR			;RESTORE ORIGINAL CONI BITS FOR COROUTINES
	CONO IBM,CNEWST			;CLEAR NEW STATUS
	CONSO PMP,CHDEMP		;GOT DEV END, CMD HLD EMPTY?
	JRST D2X1
	JRST @D2X			;CMD HLD EMPTY.  CONTINUE IN COROUTINE

↑D2X:	0
D2X1:	CONO IBM,ACTCLR
D2X2:	EXCH TAC,TSAV
	JRST 12,@D2INT

D2XE:	XOR TAC,TSTXOR			;RESTORE CONI BITS
	CONO PMP,NEWST!UNEND!10!DSKCHN	;MAKE LOW PRIORITY CHANNEL HANDLE THIS
	EXCH TAC,LSTAT			;STORE LOSING STATUS
	JRST D2X2

ITEST:	SKIPN DSKACT		;SHOULD WE BE HERE AT ALL?
	JRST D2BARF		;NO
	TRNE TAC,20		;IS DISK INTERRUPTING AT ALL?
	TRNE TAC,4		;IS HE IN LOWER CHANNEL?
	JRST D2BARF
	JRST @D2X		;ALL IS WELL?

↑D2BARF:EXCH P,ERRPD		;SAVE P AND GET A PDL
	PUSHACS
	PUSHJ P,DISMES
	ASCIZ/
IN THE DISK CHANNEL WITHOUT AN INTERRUPT. GET A WIZARD.
/
	SETOM DISFLAG
	PUSHJ P,DISFLUSH
	HALT .+1
	POPACS
	EXCH P,ERRPD
	JRST D2X2
;MORE DATA FOR D2CHN
↑SKDAT:	BLOCK 2
↑SCDAT:	BLOCK 2
↑XWCMA:	0

↑LSTREC:	0

↑ENDTST:	0

↑XWRAP:		0
↑TSAV:		0
↑LSTAT:		0
↑D2DONE:	0
↑D2LUZ:		0
↑LWCMA:		0
↑LSTOP:		0
↑XCMD:		0
↑CHNEMP:	0
↑TSTXOR:	DSKADR⊗12!20		;PACK NUMBER DPB'ED HERE
TSTBIT:		37700,,UNEND!ATTN!CUEND!BUSY!UCHK!UXCPTN!20
↑SATID1:	0		;FIRST COPY OF SATID
↑SATID2:	0		;SECOND COPY OF SATID
BEND DSKDAT
BEGIN DPYDAT
SUBTTL III AND DATA DISK DATA STORAGE

;; NOW SOME DISPLAY OPCODES AND MACROS FOR GENERATING DP INSTRS.

DISJMP←←20	;DP JMP INSTR. OPCODE.
DISJMS←←4	; JMS (STORES TWO WORDS)
DISJSR←←24	; STORES ONLY RETURN ADDR.
DISRST←←14	;RESTORE.
DISSEL←←10	;SELECT.
DISNOP←←14	;ACTUALLY RST, BUT A GOOD NOP WITH ALL BITS OFF.
DISSKP←←12	; TEST AND SKIP
DISKPN←←32	; TEST AND NOT SKIP

DEFINE LVW(X,Y,TYPE,MODE,BRT,SIZ)	;ASSEMBLES A LONG VECTOR.
  { MVW1 (MODE,TYPE,BRT,SIZ)	;TWIDDLE PARAMS.
	BYTE (11)<X>,<Y>(3)B,S(2)MD,TT(3)3 ⎇	;ASSEMBLE INSTR.
DEFINE MVW1 (M,T,BRT,SIZ)
 {IFIDN {M⎇{A⎇{MD←1;⎇MD←0	;MODE = `A' FOR ABSOLUTE.
  IFIDN {T⎇{I⎇{TT←2;⎇TT←0	;TYPE = `I' FOR INVISIBLE.
  IFIDN {BRT⎇{⎇{B←0;⎇B←BRT	;BRT = 0 IF OMITTED.
  IFIDN {SIZ⎇{⎇{S←0;⎇S←SIZ	;SAME FOR SIZ.
⎇
DEFINE CW (C1,B1,C2,B2,C3,B3) {<BYTE (8)<B1>,<B2>,<B3>(3)<C1>,<C2>,<C3>>!4}
COMMENT ⊗   NOW THE DPY PROGRAM HEADERS.  
 THERE IS ONE OF THESE FOR EACH DPY PROGRAM
 IN EXISTENCE; IN GENERAL, ONE FOR EACH CONSOLE PLUS
 ONE FOR EACH DETACHED JOB DOING DPY OUTPUT. THE HEADERS
 AND THE START,RESTART, AND STOP TABLES ARE THE ONLY PARTS
 OF THE WHOLE INCREDIBLE DPYSER DATA STRUCTURE WHICH DO NOT
 GO IN FREE STORAGE.
⊗

↑BUFL←←40		; EDITING BUFFER IS THIS MANY WORDS LONG
		ZZQ←←.
		DEFINE Z(FOO){↑FOO←←.-ZZQ
}		
 	
		XWD .+3,DISRST+40
			;PRGM. NORMALLY STARTED HERE. 
			;  RESTORE PRIOR STATE OF DP.
Z(PSELC)	BYTE (12),7777,DISSEL	;FIRST DESELECT ALL CONSOLES
Z(PSELA)	BYTE (12)1⊗(=11-0),,DISSEL	;THEN RESTORE OLD SELECTION
Z(PRGSTP)	0	;PRGM IS STOPPED BY A JMS TO HERE.
Z(PRGSAV)	0
Z(WHOCALL)	DISNOP	;CALL WHO LINE(IF ANY).
Z(PPCALL)	DISNOP	;HERE IS A JMP TO PAGE 0 OF PP.
Z(LEPOS)	DISNOP
Z(LEJMS)	XWD ZZQ+LEB,DISJMS
			;CALL THE LINE EDITOR.
Z(PGCALL)	DISNOP	;HERE A JMP TO PIECE OF GLASS CONT. BLK.
		0	;HERE PRGM NORMALLY HALTS.
Z(PSELB)		;ANOTHER COPY OF SELECT WORD. PRGM RESTARTS HERE.
		BYTE (12)1⊗(=11-0),¬(1⊗(=11-0)),DISSEL
Z(RTJMP)	XWD WHOCALL+ZZQ,DISJMP

Z (PRGNUM)	0	;NO. OF DPY THIS PRGM ATTACHED TO.
Z (BLKTOT)	-7	;NO. OF BLOCKS OF STORAGE HE CAN USE.
Z(CURPP)	0	;PTR. TO CTRL. BLK. OF SELECTED P OF P.
Z(CURPG)	0
Z(PRGACT)	400000	;BITS TELL STATE OF ACTIVATION OF P OF P'S.
Z(USRACT)	0	;SAVED VERSION OF PRGACT.
Z(LSTPG)	0	;HIGHEST PG IN USE BY USER.
Z(LECLIN)	0	; FLAG THAT SAYS THIS BLOCK HAS A CLOCK REQUEST IN TO HAVE ITSELF KILLED, WHEN IT BECOMES FREE
;FORGET THIS CELL ;Z(DPKTIM)	0	; WORD INDICATING TIME KEY WAS STRUCK
;AND THIS ONE	  ;Z(DPGTIM)	0	; TIME GRAPHICS WENT OUT
Z(DPRLSF)	0	; FLAG THAT SAYS THIS PROGRAM HEADER BELONGS TO A DETACHED JOB AND IS TO BE RELEASED
Z(PRGCW)	0	; COMMAND WORD FOR USER GRAPHICS TRANSFERS
Z(PRGJMP)	0	; JUMP TO USER PROGRAM
Z(PRGCNT)	0	; DUMMY COUNT WORD
Z(DPHOLD)	0	; -1 IF HOLDING
Z(GWORD)	0	; GARBAGE WORD. HOLDS EVERYTHING WHAT WON'T FIT ELSEWHERE
			; B0 1-PAGE PRINTER SIZE SET LAST BY CONSOLE COMMAND, 0-BY UUO
			; B1 SAME FOR PAGE PRINTER Y-POSITION.
			; B2 SAME FOR LINE HOLD COUNT
			; B3 SAME FOR GLITCH HOLD COUNT
			; B9-17 LINE HOLD COUNT
			; B18-26 GLITCH HOLD COUNT
			; B27-35 CHAR WHICH ACTIVATED LINED
Z(LHCNT)	0	; LINE HOLD COUNTDOWN
Z(GLHCNT)	0	; GLITCH HOLD COUNTDOWN
Z(LEB)

		0	;DP DOES A JMS TO HERE TO DISPLAY EDITOR BUFFER.
		0
Z(LEPPV)	0	;POINTER POSITION VECTOR FOR EDITOR POINTER.
Z(III)		LVW (-5,-14)	;WILL BE 0 ON DD
			;DRAW THE POINTER.
Z(VDTMP)	LVW (12,0)	;TEMP MAPPING STORED HERE ON DD
Z(PPHPOS)	LVW (-5,14)	;USED AS TEMP FOR DD CURSOR ROUTINES
		XWD ZZQ+LEB+1,DISRST+40
			;RESTORE BEAM POSTION.
Z(LELMAR)	LVW(0,0,I)
			;LEFT MARGIN VECTOR... USED FOR SHIFTING LONG LINES.
Z(LEBUF)	REPEAT BUFL,<XWD ZZQ+LEB,DISJMP>
			;THE EDITOR BUFFER.

Z(LEHPOS)	0	;HORIZONTAL POSITION OF POINTER (IN COLUMNS).
Z(CCPOS)	0	;LOGICAL POSITION OF POINTER, IN CHRS. FROM START OF LINE.
Z(FCPOS)	0	;NO. OF CHRS. IN LINE.
Z(LELWD)	0	;POINTER TO LAST WORD OF BUFFER IN USE (ONE BEFORE THE RETURN JMP).
Z(LSTHP)	0	; SAVED HORIZONTAL POSITION
Z(LEENQ)	0	; NUMBER OF LINE EDITOR TASKS IN THE QUEUE
Z(LEENQ2)	0	; NUMBER OF SCREEN REFRESH AND/OR HELP TASKS IN QUEUE.
Z(LECHPS)	0	; SAVED VALUE OF HORIZONTAL POSITION
Z(MAXPT)	ZZQ+LEBUF+BUFL-4
			;MAXIMUM ALLOWABLE VALUE OF LELWD (I.E., END OF BUFFER).
Z(NUMARG)	0	;REPEAT ARGUMENT.
Z(LEARG)	0	; REPEAT ARGUEMENT SAVED FOR <ESC>G COMMAND AND ITS FRIENDS
Z(LEPNT1)	0	;BYTE POINTER CORRESPNDING TO EDITOR POINTER.
Z(NTABPT)	0	;BYTE PTR. TO NEXT TAB IN LINE TO RIGHT OF CURRENT POS.
Z(NTABCT)	0	;NUMBER OF SPACES IN NEXT TAB.
Z(LEACT)	0	; LINE EDITOR TELLS DPYKILL THAT A CHARACTER HAS BEEN TYPED HERE
Z(LEINV)	0	; MEANS LINE EDITOR BUFFER IS NOW INVALID
Z(LEWAKE)	0	; THIS IS SET BY A TRANSFER THAT IS ABORTED BECAUSE OF INVALID BUFFER
Z(NCRS)		0	; NUMBER OF LONG-LINE CRLFS IN LINE
Z(LEVP)		0	; VERTICAL POSITION OF LINE EDITOR LAST TIME IT WENT OUT
Z(LEHP)		0	; HORIZONTAL POSITION OF LINE EDITOR
Z(LENCRS)	0	; NUMBER OF LINES IT TOOK LAST TIME IT WENT OUT.
Z(LECVP)	0	; LAST CURSOR VERTICAL POSITION
Z(LECHP)	0	; LAST CURSOR HORIZONTAL POSITION
Z(LECLK)	0	; MEANS CLOCK REQUEST IS IN
Z(LETXC)	0	; MEANS LINE EDITOR TEXT HAS CHANGED
Z(LEMISS)	0	; INDICATES A TRANSFER MISSED DUE TO BUFFER INVALID
Z(LECC)		0	; SAYS WHETHER AN <ESC>C HAS BEEN TYPED
Z(LELINE)	0	; LINE NUMBER OF LINE EDITOR
Z(CVP)		0	; CURRENT CURSOR VERTICAL POSITION
Z(CHP)		0	; CURRENT CURSOR HORIZONTAL POSITION
Z(WHOTAB)	0	; WHO LINE TIME,,JOB #
Z(WHORUN)	0	; TIME WHEN RUN TIME SHOULD BE UPDATED ON WHO LINE
Z(LETBPT)	0	;PTR. TO THE LETAB ENTRY FOR THIS DPY.
Z(LCH)		0	;
Z(DPYLEN)

ORG ZZQ			; DON'T LOSE ANY STORAGE OVER THESE DEFINITIONS
↑STRTBL:BLOCK DPYNUM	;THIS TABLE, INDEXED BY DISPLAY NO.,
			;GIVES NORMAL START POINT FOR ITS PROGRAM.

	0		;STPTBL(-1) FOR HOLDING MESSAGE
↑STPTBL:BLOCK DPYNUM	;SAME THING FOR STOP POINTS.
	0		;STPTBL(DPYNUM)	FOR IDLE STATE

↑SELTBL:BLOCK DPYNUM	;POINTERS TO SELECT WORDS
↑RSTTBL:BLOCK DPYNUM	;RESTART (I.E. BEGINNING OF PRGM) POINTS.
↑LETAB:	BLOCK DPYNUM+DDNUM	; LINE EDITOR HEADERS ARE HERE
	BLOCK DPYNUM	;EXTRA 6 0'S FOR VDSMAP ROUTINES ADDRESSING "SHADOW" CHANNELS

↑DXFLAG:	0	;APAIR OF FLAGS FOR SYNCHRONIZING DP RESTARTING WITH
↑DRUNCT:	0	; NUMBER OF CURRENTLY RUNNING DISPLAY
↑SAVTAC:	0	; DPY NUMBER DURING ERROR TYPEOUT
↑DPCNI:		0	; DP CONI BITS
↑LCPDL←←100		;LENGTH OF CLOCK PUSHDOWN LIST.
↑DPYPDL:	IOWD LCPDL,CLKPD
			;SPECIAL CLOCK LEVEL PDL.
↑CLKPD:		BLOCK LCPDL+1
		0
↑CLKQUE:	BLOCK 6*<DPYNUM+DDNUM>

↑CLKQ:		POINT 36,CLKQUE-1,35
			;MAIN PTR. TO CLK QUE.

↑WTFLG:		0	;IF -1, WE ARE SUSPENDING NORMAL CLK. SERVICE TO WAIT FOR FREE STG.

↑SVAC:		BLOCK 20
↑DPYMAP:	BLOCK JOBN
↑NBS←←=100
↑TBL:		BLOCK NBS+1
			; PLACE TO BUILD BLOCK MAP FOR UPGMOVE
↑ERRP:		0	; ROUTINE THAT IS ENTERED WITH A JSA
		JRST ERRP2
↑FREEHD:	0
↑FSWTHD:	0
↑FSWT2H:	0
↑FREEC:		0
↑FREETL:	0
↑FRETOT:	0
↑FSWC:		0
↑CLKLVL:	0	; SAYS WE ARE AT CLOCK LEVEL
↑CLKQTMP:	0	; TEMP CELL
↑FSW2C:		0
; DATA DISK DATA STORAGE

↑DDSTART:	0	; UUO LEVEL SETS THIS TO START UP DD. SEEN BY APRINT.
↑DDCNT:		3B2	; NUMBER OF TIX THIS PROGRAM IS ALLOWED TO RUN BEFORE IT IS TIMED OUT.
↑DDDSP:		0	; THIS IS THE I-LEVEL DISPATCH ADDRESS.
↑DDRET:		0	; WE JUMP INDIRECT HERE TO RETURN FROM I-LEVEL
↑DDRTN:		0	; EVERYONE JSRS HERE TO RETURN
		JRST @DDRET
↑DDSAC1:	0	; ACCUMULATORS . . .
↑DDSAC2:	0
↑DDSAC3:	0
↑DDSTAC:	0
↑DDSDAT:	0
↑DDNXT:		0	; ADDRESS OF NEXT TASK TO BE DONE
↑DDCUR:		0	; DATA BLOCK ADDRESS CURRENTLY IN USE
↑DDCURT:	0	; TASK BLOCK ADDRESS CURRENTLY IN USE
↑DDCURQ:	0	; THIS IS WHERE I-LEVEL PUTS THE CONTROL BLOCK ADDRESS BEFORE DISMISSING
↑DDCOL:		0	; HERE WE KEEP COLUMN ADDRESSES
↑DDLST:		0	; ADDRESS OF LAST FRAME LOOKED AT
↑DDOFF:		0	; SET TO -1 TO INHIBIT DD TRANSFERS
↑DDQUE:		0	; HERE LIES THE DATA DISC QUEUE
↑DDSQ:		0	; WE SAVE THE ENTIRE TASK QUEUE HERE
↑DDLFD:		0	; WE SAVE THE FIELD WORD OF THE LAST FRAME HERE.
↑LEBFR:		CW 1,46,2,0,3,2
		CW 3,2,4,0,5,0
		0
		0
↑DDCURS:	0
		CW 3,1,4,0,5,0
		REPEAT 20,<2>
		CW 0,0,3,1,3,1
		0
↑CZPNT:		POINT 36,CURZWD-1,35
↑CURZWD:	BLOCK 4
↑DDCRLF:	REPEAT =40,<ASCID /  
/>
		0
↑DDRUN:		0	; TELLS IF DD IS CURRENTLY RUNNING
↑DDERRS:	CW 1,46,2,0,3,1
		CW 3,2,4,0,5,0
		XWD DDCRLF,DISJMP

↑WSERC:		CW 1,17,2,0,3,2
		CW 1,46,2,0,3,2
		0
↑DPYARN:	0	; DENOTES THAT 'CONSOLE AVAILABLE' MESSAGE HAS BEEN RUN THIS TICK
↑DPYAVL:	LVW -600,0,I,A,2,4
		XWD 770000,DISSEL
		<BYTE (8)377>!DISSKP
		XWD TTYLOK,20!DISRST
		<BYTE (8)367,0,367>!DISKPN
		XWD DPYAV2,DISJMP
		XWD MAINTMODE,20!DISRST
		<BYTE (8)367,0,367>!DISSKP
		XWD DPYAV1,DISJMP
DPYAV2:		ASCID /SYSTEM IS DOWN!!!/
		0

DPYAV1:		ASCID /TAKE ME I'M YOURS!/
		0
;*** RPH PATCH TO CATCH LOSING DP
		XWD .+1,24
		0
		XWD .-2,20
;END PATCH

↑AVLWHO:	CW 1,17,2,0,1,46	;WE SEND AN ERASE DURING FIRST FIELD ONLY
		0
		AVLWDD,,DISJMP
		ASCID / 
/
↑DDWMES:	1				;PATCH HERE TO DISPLAY OTHERS
		ASCID /                                 Take Me I'm Yours!
/
		0

AVLWDD:		ASCID /             DD JBS,TCOR  R,RCOR UCOR  NL DSKQ
/
		COMDD,,DISJMP

↑DDUNMS:	ASCID /                             No Data Disk Channels Left
/
		0

↑DDDMES:	ASCID /                                   System Is Down!
/
		0

↑AVLLN:		0		;XWD FIRST,SECOND TEXT LINE FOR AVL MSG
↑AVLVP:		CW 3,2,4,2,5,4	;GETS CLOBBERED BY PHANTOM STARTER
↑WHOKLU:	0		;COUNTS DOWN TO AVL MSG SHIFT OR -1 TO GOOSE WHOSER

↑DDSTRS:	CW 1,46,2,0,3,2
		CW 3,2,4,1,5,11
		ASCID /   ********************** →HOLDING← **********************/
		CW 0,0,3,2,3,2
		0

↑DPYHOL:	0
↑DPYHLD:	XWD 77,DISSEL
		LVW (-600,660,I,A,2,2)
		ASCID /   ********************** →HOLDING← **********************/
		COMIII,,DISJMP			;GO DISPLAY SYSTEM LINE OF WHO LINE

;MODEL WHO LINE BLOCK (COPIED INTO FREE STORAGE)
↑TITLE:		0		;III JSRs to here.  FOR DD, COMMAND WORD GOES HERE
		BYTE(11)<-1000>,740(3)2,2(2)1,2(3)3 ;III POSITION WORD.  DDs PUT CMD WORD HERE
		COMDD,,DISJMP	;IIIs get a no-op deposited here.
↑WTEND←←.-TITLE
↑WTTYS:		REPEAT 3,<ASCID/     /
		>		;SPACE FOR FIRST PART OF USER WHO LINE
		ASCID	/  /	;three nulls here (NOT TO MENTION 2 SPACES)
		REPEAT 3,<ASCID/     /
		>
		ASCID	/   K        -             -        / ;7 words of constants
		REPEAT 4,<12
		>		;SPACE FOR SEGMENT NAME AND ALIAS
		ASCID	/
/				;CRLF TO FINISH USER LINE
↑WLINK←←.-TITLE
		0		;DD HALT.  FOR III, A JMP TO TITLE GETS PUT HERE

;DISPLAY SUBROUTINE FOR SYSTEM DATA ON FIRST LINE OF WHO LINE
↑COMIII:	BYTE(11)<-1000>,770(3)2,2(2)1,2(3)3	;III POSITION WORD.
↑WHOSEL:	770000,,DISSEL	;HERE WE SELECT WHICH III'S GET THE SYSTEM WHO LINE
↑COMDD:				;DDD PROCESSOR ENTRY POINT
↑COMWHO:	ASCID/                   ,       ,       K    %   D          / 
		ASCID/              :  
/				;CONSTANTS IN SYSTEM LINE
		DISKPN		;SKIP ALWAYS, IF III
		.+2,,DISJMP	;NO COMMENT!
		0		;III HALTS HERE
		CW (3,2,3,2,3,2);SELECT COL 2.  DISKPN ISN'T QUITE A NO-OP ON DDD!
↑DDDRET:	DISJMP		;DD JMP TO USER LINE OF WHO LINE.  ADR PLACED IN LH

↑DDTAB:	BLOCK 40	;CHANNEL TABLE
↑DDFLST:	0	;FREE LIST HEADER, MUST FOLLOW DDTAB
↑DDFCNT:	0	;# FREE CHANS
↑AVLCHN:	11	;CHAN FOR AVAIL MSG
↑AVLBIT:	0	;BIT   "    "    "
↑VDMAP:	BLOCK DDNUM	;THE PERMANENT MAP
	BLOCK DPYNUM	;CELLS FOR "SHADOW" CHANNELS

	BEND DPYDAT
BEGIN DTCDDB
SUBTTL	DTCDDB 06-AUG-68 DECTAPE DATA BLOCK

;DTA DEVICE DATA BLOCKS

DEFINE CAT6'(A,B),<SIXBIT /A'B/>
	
DEFINE DTCDDX!(UNIT),<
	REPEAT	DDBSKW-1,<0>	;SKEW-ZEROES
	DEVLUP,,0		;DEVCMR
	ZZ←.
IFE UNIT,<↑DTCDDB←.>
	CAT6(DTA,\<UNIT+1>)
	XWD	=10*HUNGST,200+<UNIT+1>⊗PUNITP	;LONG HUNG COUNT IS INSERTED WHEN A DUMP
						;MODE OPERATION HAPPENS.
	0
	XWD	IFE UNIT-(DTCNUM-1),<MTCDDB,DTCDSP;>LINK,DTCDSP
	LINK←.-4
	XWD	DVDIR+DVIN+DVOUT+DVDTA+DVLNG,154403
	0
	0
	XWD	PROG,0
	XWD	PROG,0
	XP	DTNEXT,.-ZZ	;LH=NEXT OUTPUT BLOCK NO.
					;RH NEXT INPUT BLOCK NO.
	0
	XP	DTERR,.-ZZ	;ERROR COUNT OF FATAL ERRORS
	0
	XP	CURENT,.-ZZ	;POINTER TO CURRENT DIR ENTRY(ABSOLUTE)
	0
	XP	UFREE,.-ZZ	;RH=LAST BLOCK USED. 1 FOR A CLEARED DIRECTORY
	XWD	0,0		;LH=BLKCNT WHILE TAPE INACTIVE, INIT AT BLD TIME
	XP	UDIR,.-ZZ		;LINK TO DIRECTORY IN DATA BLOCK
	.+1		;ADDR DTA DIRECTORY
	BLOCK	200		;DTA DIRECTORY
>

UNIT←DTCNUM-1
; THE FOLLOWING EXPANSION OF THE MANY DECTAPE DEVICE DATA BLOCKS
; HAS BEEN XLIST'ED OUT FOR YOUR READING CONVENIENCE.
; THEY ACTUALLY LOOK LIKE THIS:
; REPEAT DTCNUM,<DTCDDX(UNIT)
;         UNIT←UNIT-1>
XLIST
REPEAT DTCNUM,<DTCDDX(UNIT)
	UNIT←UNIT-1>
LIST
;TEMPORARY STORAGE FOR DECTAPE SERVICE
↑BLKPTR:	0	;BLKI/BLKO POINTER.
↑DMPPTR:	0	;DUMP MODE BLKI/BLKO POINTER
			;MOVED TO BLKPTR AT INTERRUPT
↑DMPLST:	0	;RELATIVE POINTER TO CURRENT DUMP MODE
			;COMMAND LIST WORD
↑DTOTAL:	0	;TOTAL ERROR COUNT FOR SYSTEM SINCE IT WAS
			;LOADED(COUNT NOT CLEARED AT SYSTEM INITIALIZATION)
↑DFTOTAL:	0	;TOTAL FATAL ERROR COUNT FOR SYSTEM SINCE LOADED
			;IE FAILED DTTRY (3 USUALLY) TIMES
↑DTTAC:		0	;PLACE TO SAVE TAC ON DT CHANNEL
↑DTUNIT:	0	;DT UNIT IN BITS 30-32,DT PI CHAN. BITS 33-35
↑ERRFLG:	0	;DATA MISSED BY DC IF NON-ZERO
↑RBNCNT:	0	;COUNT DOWN NUMBER OF REVERSALS SEEKING BLOCK
↑UBUF:		0	;ABS. ADR. OF SECOND WORD OF USER BUFFER
↑UERRCN:	0	;NO. OF ERROR SO FAR ON THIS OPERATION
↑UPROG:		0	;XWD PROTECTION,RELOCATION FOR JOB USING DECTAPES
↑UDPROG:	0	;XWD 0,RELOCATION(USED BY DUMP MODE ONLY)
↑USVDB:		0	;ADR. OF DEVICE DATA BLOCK FOR CURRENT UNIT
↑BLKCNT:	0	;COUNT OF NO. OF BLOCKS WHICH CURRENT JOB
			;USING DECTAPES CAN DO BEFORE HAVING TO GIVE
			;THEM TO ANOTHER JOB IF ONE IS WAITING
			;THIS IS SETUP AT UUO LEVEL AND DECREMENTED AT
			;JOB DONE TIME AT INTERRUPT LEVEL
			;IF TAPE MUST SEARCH FOR BLOCK, COUNT IS SET TO ZERO
			;MEANING THAT QUANTUM IS EXCEEDED IMMEDIATELY


↑UBKN:		0
↑BNDISP:	0
↑CONSZ1:	0
↑RDBN:		0
		JRST RDBN1
↑WTRV:		0
		JRST WTRV1
↑RDRV:		0
		JRST RDRV1
↑ENPT:		0
		JRST ENPT0
↑ENPT1:		0
		JRST ENPT2
↑DMPADV:	0
		JRST DMPA0
↑DCLOC:		0
↑DCLOC1:	0

	BEND DTCDDB
IFN FTDISK,<
;;TASK BLOCK DEFINITIONS . . .

FBADR←←0
FBWC←←1
FBDONE←←2
FBDA←←3
FBRETRY←←4
FBBND←←5
FBJOB←←6
FBLINK←←7

↓FBSIZ←←FBLINK+1

;;NUMBER OF BANDS THE THING HAS . . .

↓NBANDS←←170
MAXFB←←40

BEGIN FBDAT
SUBTTL DATA FOR LIBRASCOPE SWAPPER AND FAST BAND PACKAGE

↑IEARLY:	0	;ENABLE IOP EARLY RESPONSE PRINTOUT

↑FBQUE:		0	; TOP OF TASK LIST

↑SYSBAND:	100B23
↑SYSBND:	100		; BAND WHERE SYSTEM LIVES
↑DDTBAND:	101B23

↑FBBANDLIST:	REPEAT 60,<-1>	;0-57	;NO DISK HERE ANY MORE
		REPEAT 70-57,<0>	;60-70 OK
		-1			;71 EATS IT
		0			;72 OK
		0
		0
		-1			;75 LOSES
		REPEAT 101-75,<0>	;76-101 OK
			-1	;102	PERMANENT READ ERROR
			-1	;103	PERMANENTLY BAD!
			-1	;104	PERMANENT READ ERROR
			-1	;105	PERMANENT READ ERROR
			0	;106	OK
			-1	;107	BAD BAND 2-22-73
			0	;110	OK
			0	;111	OK
			-1		;112 BAD
		REPEAT 131-112,<0>	;113-131 OK
			-1		;132 BAD
			0		;133 OK
			0		;134 OK
			0		;135 OK
			-1		;136 BAD
		REPEAT NBANDS-136,<0>	;REST OK

↑FBBUSY:	-1
↑FBTASK:	0
↑FBACT:		0
↑FBSPARE:	BLOCK FBSIZ
↑FBSBUSY:	0
↑LASTADR:	0		;LAST SECTOR, TRACK, AND BAND
↑LASTWC:	0		;LAST WCMA SENT
↑IOPWRD:	0		;WORD IOP GOT PAR ERR ON
↑IOPWCM:	0		;IOP WCMA FOR PARITY ERROR, DATA MISS.

BEND FBDAT
>
BEGIN LPTDDB
SUBTTL LPTDDB - 10 SEPT 68 - JAM


;LPT  DEVICE DATA BLOCK
REPEAT DDBSKW-1,<0>	; PUT IN PROPER NUMBER OF ZEROS FOR SKEW PURPOSES
		DEVIBF!DEVLUP,,0		;INTERNALLY BUFFERED DEVICE
↑LPTDDB:	SIXBIT	/LPT/
		XWD	=10*HUNGST,LPTSIZ+2
↑LPTIOS:	0
		XWD	XGPDDB,LPTDSP
		XWD	DVOUT!DVLPT,4403	;MODES 13,10,1,0
		0
		0
		0
		XWD	PROG,0
↑LPTIBF:	BLOCK LPTBLN	; SYSTEM BUFFER
↑LPTDCN:	0		; DANGLING CHARACTER COUNT
↑LPTBG1:	0		;SET TO EJECT FORMS BEFORE FIRST OPERATION
↑LPTUBP:	POINT 7,LPTIBF	; UUO LEVEL POINTER
↑LPTIBP:	LPTIBF		; INTERRUPT LEVEL POINTER
↑LPTCC:		5*LPTBLN	;  TOTAL CHARACTER COUNT
↑LPTLCC:	LPTCPL		; CHARS PER LINE

	BEND LPTDDB
BEGIN XGPDDB	↔ SUBTTL DATA STORAGE FOR XGP SERVICE
;REG JAN 11 1973.  REVISED THRU 8 JUNE 1973

REPEAT DDBSKW-1,<0>
		DEVIBF!DEVLUP,,XGPCSC		;DEVICE HAS INTERNAL BUFFER.
						;(SOMETIMES)
↑XGPDDB:	SIXBIT	/XGP/
		5*HUNGST,,401			;RH = BUFFER SIZE.
↑XGPIOS:	0
		ADDDB,,XGPDSP
		DVLPT!DVLNG!DVOUT,,104401	;MODES 0,10,17,13
		0				;DEVLOG
		0				;DEVBUF
		PROG,,0				;DEVADR
		PROG,,0				;DEVOAD
		0
		0
		0

↑XGPCSC:	BLOCK	PSYNCN			;INTER PROCESSOR SYNCHRONIZATION.

↑XGPP1F:	0				;SET TO SIGNAL PDP-10
↑XGPP2F:	0				;SET TO SIGNAL PDP-6

↑XYNCNT:	0				;SYNC COUNT
↑XGPCNT:	0				;COUNTS VARIOUS THINGS
↑XGPCNY:	0				;COUNTS PAPER FEED AT END
↑XGPKIL:	0				;SET WHEN PDP-10 WANTS XGP TO DIE.

↑XGPIWD:	0				;IOWD FOR CURRENT DUMP COMMAND
↑XGPBIG:	0				;REMAINDER OF IOWD
↑XGPMDP:	0				;POINTER TO CURRENT DUMP COMMAND
↑XGPNXC:	0				;POINTER TO NEXT DUMP COMMAND
↑XGPROG:	0				;RELOC OF USER.
↑XGPGCW:	0				;GROUP CONTROL WORD.

↑XDISP1:	0				;DISPATCH LEVEL 1
		JEN	@XGPCHL			;DISMISS INTERRUPT.
						;JSR XDISP1 TO CHANGE DISPATCH AND
						;DISMISS.

↑XDISP2:	0				;DISPATCH LEVEL 2
		POPJ	P,

↑XGPAOK:	0				;PDP-6 SETS THIS ON EACH INTERRUPT.
↑XGPBIT:	0				;PDP-10 TELLS WHAT IT WANTS HERE
↑XGPGO:		0				;SET BY PDP-10 WHEN JOB LOCKED IN.
↑XGPTMP:	0				;1 CELL FOR I-LEVEL.
↑XPGOOD:	0				;CELL FOR 'GOOD CUTS'.

↑XTAKE:		0				;POINTER FOR PDP-6.
↑XPUT:		0				;POINTER FOR PDP-10
↑XIBUF:		0				;CONTAINS THE ADDRESS OF THE BUFFER.
↑XIBFND:	0				;ADDRESS OF END OF BUFFER.
↑XBFCNT:	0				;COUNT OF WORDS USED IN BUFFER.
↑XGPWSZ:	0				;SIZE NEEDED BEFORE REACTIVATION.
↑XGPBFL:	0				;FLAG SET FOR MODE 10, ZEROED FOR 17

↑XGPOST:	BLOCK	20			;OLD STATUS OF FC
↑XGPNST:	BLOCK	20			;NEW STATUS OF FC.
↑XGPFC1:	0				;SET WHEN WE WAIT FOR FC
↑XGPFC2:	0				;SET WHEN FC WAITS FOR US
↑XCLKNM:	0				;CLOCK REQUEST IDENTIFIER
↑XFCJN:		0				;FC JOB NUMBER
↑FCRQER:	0				;FLAG FOR FC NOT RESPONDING.
↑XFCADR:	0				;RELATIVE ADDRESS OF THE FC
↑XFTADR:	BLOCK	20			;ADDRESS OF FONT TABLE IN FC

↑XGPSLS:	0				;SPECIAL LINE SPACE COUNT. '177'1'42

↑XCFH:		0				;CURRENT FONT HEIGHT
↑XCFBL:		0				;CURRENT BASE LINE
↑XCFCPA:	0				;CURRENT COLUMN POSITION ADJUSTMENT.
↑XHMAX:		0				;MAXIMUM HEIGHT IN CURRENT LINE.
↑XLBL:		0				;XLBL CURRENT LINE'S BASE LINE.
↑XFTCAD:	0				;CURRENT FONT ADDRESS (RELOCATED)
↑XSCNLN:	0				;CURRENT SCAN LINE IN LINE
↑XGPERC:	BLOCK	4			;ERROR CONDITION CODES.
↑XGPPG2:	0				;"PAPER PAGE" COUNT
↑XGPHIP:	0				;"HEADING IN PROGRESS"
↑XGPHDW:	0				;IOWD FOR HDB
↑XGPHDB:	BLOCK	=26			;TEXT FOR HEADINGS. USE HDW
↑XGPAT0:	0				;THREE TEMP CELLS FOR 
↑XGPAT1:	0				;PAPER PAGE MACRO EXPANSION.
↑XGPAT2:	0
↑XSVCAD:	0				;SAVE OLD FONT WHILE IN HEADING.
↑XGPIGO:	0				;SET TO -1 BY PDP6 WHEN DATA XFER
↑XUSBEG:	0				;COLUMN OF BEGINNING UNDERSCORE.
↑XCHBGO:	0				;SET TO ADDRESS OF FIRST TEXT NODE.
↑XVNODE:	0				;SET TO ADDRESS OF VECTOR NODE.

;LIST HEADERS FOR COMPILER/TEXT PROCESS
↑XVNFL:		0				;VECTOR NODE FREE LIST
↑XTNFL:		0				;TEXT NODE FREE LIST
↑XATLH:		0				;ACTIVE TEXT LIST
↑XASVLH:	0				;ACTIVE NARROW VECTOR LIST
↑XALVLH:	0				;ACTIVE WIDE VECTOR LIST
↑XPENDH:	0				;PENDING QUEUE HEAD
↑XPENDT:	0				;PENDING QUEUE TAIL

XGPPDX:		BLOCK	20			;PDL FOR CHANNEL 4 COMPILER.
↑XGPPDL:	IOWD	20,XGPPDX		;POINTER TO PDL

↑XACT4:		0				;FLAG CH4 NEEDS ACTIVATION.
↑XCYPOS:	0				;Y POSITION FOR CURRENT LINE.
↑XGPLYP:	0				;LAST Y POSITION QUEUED
↑XFREBA:	0				;POINTER TO BLOCK IN FC.
↑XNODUS:	0				;# OF TEXT NODES IN USE.
↑XTOFRM:	0				;SET TO -1 WHEN THERE IS TEXT Q'ED
↑XLFTKF:	0				;SET TO -1 WHEN WE DID KERN ADJUST
↑XGPSAC:	BLOCK	20			;CH4 CO-ROUTINE AC'S


↑XFLAPA:	0				;MORE BITS FOR FLAPPER
↑XFLAPB:	0				;BITS TO DECIDE WHEN TO FLAP
↑XFLAPC:	0				;FLAPPER COUNT
↑XCUTQ:		BLOCK	=48			;QUEUE OF CUT POINTS
↑XCUTBP:	POINT 36,XCUTQ-1,35		;BYTE POINTER TO XCUTQ

;THE REST OF THIS IS INITIALIZED BY RESET
↑NTNODE←←=16					;(DEFAULT) NUMBER OF TEXT NODES
↑NVNODE←←=100					;(DEFAULT) NUMBER OF VECTOR NODES
↑XGPBL1←←4000					;(DEFAULT) SIZE OF SYSTEM BUFFER

↑XGPPS1:	=200				;TOP TO FIRST LINE MARGIN
↑XGPPS2:	=1790				;TOP LINE TO LAST LINE SIZE.
↑XGPPS3:	=200				;LAST LINE TO BOTTOM MARGIN
↑XGPLMR:	=200				;LEFT MARGIN
↑XGPRMR:	=1650				;RIGHT MARGIN
↑XGPILS:	=4				;INTER-LINE SPACING
↑XNTNOD:	NTNODE				;NUMBER OF TEXT NODES
↑XNVNOD:	NVNODE				;NUMBER OF VECTOR NODES
↑XGPBLN:	XGPBL1				;SIZE OF SYSTEM BUFFER

↑XMSET:	=200					;SET MARGINS (ETC) FROM THIS BLOCK
	=1790
	=200
	=200
	=1650
	=4
	NTNODE
	NVNODE
	XGPBL1

BEND	XGPDDB
BEGIN PTRDDB -- PAPER TAPE READER DEVICE DATA BLOCK
SUBTTL PTRDDB - J. SAUTER - 10-NOV-68

		REPEAT DDBSKW-1,<0>	; PUT IN ALL THE EXTRA WORDS
		DEVLUP,,PTRCSC		; PUT IN ADDRESS OF CONTROL CELLS
↑PTRDDB:	SIXBIT /PTR/
		XWD =10*HUNGST,41
		0
		XWD PTPDDB,PTRDSP
		XWD DVPTR+DVIN,14403
		0
		0
↑PTRADR:	XWD PROG,0
↑PTRPTR:	0
		0			;PTR COUNTER
↑PTRACT:	0
↑PTRIN1:	0
↑PTRADV:	0
↑PTRSTR:	0
↑PTRCHR:	0
↑PTRDSC:	0			;SET TO -1 TO MAKE PTR DISCONNECT.
↑PTRCSC:	BLOCK PSYNCN
↑PTRCON:	0			;SET TO PTRCN1 OR PTRCN2.

BEND PTRDDB
BEGIN PTPDDB -- PAPER TAPE PUNCH DEVICE DATA BLOCK
SUBTTL PTPDDB - JAM - 10-NOV-68

REPEAT DDBSKW-1,<0>		; PUT IN PROPER NUMBER OF SKEW WORDS
		DEVIBF!DEVLUP,,PTPCSC
				; TELL WORLD THAT THIS IS AN INTERNALLY BUFFERED DEVICE . . .
				; AND THAT IT HAS CONTROL CELLS
↑PTPDDB:	SIXBIT /PTP/
		XWD =20*HUNGST,41
↑PTPIOS:	0
IFE IMPSW,<	XWD LPTDDB,PTPDSP>
IFN IMPSW,<	XWD DDBMDL,PTPDSP>
		XWD DVPTP+DVOUT,14403
		0
		0
↑PTPPTR:	0
↑PTPADR:	XWD PROG,0
↑PTPIBP:	0		; INTERRUPT-LEVEL BYTE POINTER
↑PTPUBP:	0		; UUO-LEVEL POINTER
↑SYSPDL:			;SYS INIT PDL MOVED HERE FROM TTY DDB 5/6/74 BH
↑PTPBUF:	BLOCK PTPBLN	; BUFFER ITSELF
↑PTPFCN:	0		; PUNCH FEED COUNT
↑PTPBCN:	0		; BUFFER CHARACTER COUNT
↑PTPIDS:	0		; INTERRUPT-LEVEL DISPATCH LOCATION
↑PTPUDS:	0		; UUO-LEVEL DISPATCH LOCATION
↑PTPCPW:	0		; CHARACTERS PER WORD
↑PTPACT:	0		; FLAG ASKING TO TURN ON PTP
↑PTPMOD:	0		; MODE OF OPERATION
↑PTPSID:	0		; P2 ASKING P1 TO CALL SETIOD
↑PTPCSC:	BLOCK PSYNCN	; 2-PROCESSOR SYNCHRONIZATION CONTROL REGISTERS
↑PTPCON:	0		; SET TO PTPCN1 OR PTPCN2

BEND PTPDDB
BEGIN SCNDDB
;DESCRIPTION OF DEVICE DATA BLOCK FOR TELETYPES

;THE FUNCTIONS OF THE FIRST EIGHT WORDS ARE AS DESCRIBED IN THE
;COMMENTS IN THE SYSTEM PARAMETER TAPE( FILE NAME S). LOCATIONS 11
;THROUGH 27 (OCTAL) RELATIVE TO SCNDDB PERTAIN DIRECTLY TO THE
;SCANNER SERVICE BUFFERING SCHEME. THE SUBSEQUENT 2*20(OCTAL) LOCATIONS
;ARE CURRENTLY THE TWO TELETYPE BUFFERS. THEY NEED NOT BE IN THE DDB
;AS LONG AS THEIR ADDRESSES ARE PLACED IN THE RIGHT HALF OF TTIBUF,
;AND TTOBUF EITHER AT ASSEMBLY, BUILD OR RUN TIME. IF DYNAMIC
;BUFFER CONSTRUCTION IS TO BE ADDED THESE BUFFERS MAY BE PLACED ANYWHERE IN
;FRE CORE STORAGE, AND THE RIGHT HALF OF THE REQUIRED TTXBUF(WHERE "X"
;MAY BE "I" OR "O")MAY BE LOADED ONLY WHEN THAT BUFFER IS REQUIRED.

;THERE ARE TWO BUFFERS, EACH OF WHICH IS A "RING" UNTO ITSELF:
;INPUT---POINTED TO BY TTIBUF
;	ALL CHARACTERS TYPED GO INTO THIS BUFFER. IN ADDITION, ALL
;OTHER COMMANDS TO BE READ BY THE COMMAND INTERPRETER IN COMCON
;(APRSER) ARE STORED HERE.
;OUTPUT BUFFER---POINTED TO BY TTOBUF
;	ALL CHARACTERS THAT ARE OUTPUT ARE PLACED SEQUENTIALLY IN THIS
;BUFFER; THIS INCLUDES ECHOED CHARACTERS AS WELL AS NORMAL OUTPUT OF
;CHARACTER STRINGS.

;THERE ARE NINE BUFFER PARAMETER WORDS ASSOCIATED WITH EACH BUFFER
;(EXCEPT FOR THE OUTPUT BUFFER, WHICH ONLY NEEDS SIX). THE LAST
;FOUR CHARACTERS IN THE MNEMONIC DESCRIBES THE FUNCTION OF THE WORD
;WHILE THE FIRST TWO CHARACTERS IDENTIFY WHICH BUFFER THAT THE
;FUNCTION APPLIES TO. THE FORMULA FOR THESE WORDS IS TX'FUNC, WHERE
;THE RELATIVE POSITION OF ALL TX'FNC1 TO TTX'BUF IS THE SAME FOR
;ALL BUFFERS.  IN THIS MANNER, THE ADDRESS OF TTX'BUF IS LOADED INTO
;ACCUMULATOR DAT, AND THE RELATIVE POSITIONS FUNCT1-FUNCT9 ARE
;DEFINED TO BE 0-10 (OCTAL); I.E., FUNCT(DAT) WILL IDENTIFY THE DESIRED
;BUFFER PARAMETER WORD REGARDLES OF BUFFER.
;FOLLOWING ARE DEFINITIONS OF THE RELATIVE BUFFER PARAMETER WORDS:
;TTX'BUF OR BUF(DAT)---THE LEFT HALF CONTAINS NUMBER OF BYTES IN BUFFER AND THE RIGHT
;	HALF THE ADDRESS OF THE FIRST WORD OF THE BUFFER. THIS WORD IS
;	ONLY READ BY THE CURRENT CODE.  UPON THE ADDITION OF DYNAMIC
;	BUFFER ALLOCATION, THIS WORD WOULD BE LOADED IN THE SAME FORMAT
;	AT THE TIME THAT THE BUFFER WOULD BE BUILT.
;
;SCNINI SETS BUFFERS TO LENGTH TTYCHR AT PRESENT. ALSO
;PRESENT CODE OCCASIONALLY USES TTYCHR RATHER THAN READING LH
;OF TTXBUF
;
;TX'PUTR OR PUTR(DAT)---BYTE POINTER USED TO PLACE CHARACTERS INTO THE
;	BUFFER. IT MUST ALWAYS BE AHEAD OF OR EQUAL TO THE TAKER POINTER.
;TX'PCTR OR PCTR(DAT)---COUNT OF NUMBER OF TIMES THAT PUTR MAY BE INCREMENTED
;	BEFORE REACHING THE LAST BYTE IN THE LAST WORD OF THE BUFFER
;	(NOT THE AMMOUNT OF FREE SPACE LEFT)
;TX'TAKR OR TAKR(DAT)---BYTE POINTER USED BY ALL ROUTINES TO PICK UP
;	CHARACTERS FROM THE BUFFER. WHEN THE TAKR IS EQUAL TO THE PUTR,
;	THE BUFFER IS "EMPTY".
;TX'TCTR OR TCTR(DAT)---COUNT OF THE NUMBER OF TIMES THAT THE TAKR CAN
;	BE INCREMENTED BEFORE REACHING THE PHYSICAL END OF THE BUFFER.
;TX'FCTR OR FCTR(DAT)---FREE CHARACTER COUNT; I.E., HOW MANY TIMES MAY THE
;	PUTR BE INCREMENTED BEFORE IT WOULD COME AROUND AND "STEP ON"
;	THE TAKR. WHEN THE FREE CHAR. COUNT IS ZERO, NO MORE CHARACTERS
;	MAY BE PLACED IN THE BUFFER (USUAL RESULT IS GOING INTO IO WAIT)
;TX'SYNC OR TSYNC(DAT)---COUNT OF NUMBER OF "LINES" THAT HAVE BEEN TYPED
;	INTO INPUT BUFFER.
;SCANNER DEVICE DATA BLOCK.
;REMAINING SCN DDB'S ARE GENERATED
;OUT OF LINE AT BUILD TIME.
;THIS DDB IS USED FOR THE CTY AND NEVER KILLED   BH 5/6/74

↑OFFSET←←5	;NUMBER OF COMPILED IN DDBS
↑TTPLEN←←SCNNUM+DPYNUM+DDNUM+PTYNUM+1

Z←←0;
LINK←←0
REPEAT DDBSKW,<XWD DEVAOA,0>		;IGNORE IOACT FOR OUTPUT UUO
↑SCNDDB:
↑TTYLST:
	ZZ←.
	SIXBIT /CTY/			;DEVNAM
	TCONLN⊗13+UTTYBF+1		;DEVCHR(NO HUNG TIME),,BUFFER SIZE+1
	Z				;DEVIOS
	XWD	LINK,SCNDSP		;DEVSER
	XWD	DVTTY+DVIN+DVOUT,15403	;DEVMOD (ALLOWS MODES 0,1,10,11,13,14)
	Z				;DEVLOG
	Z				;DEVBUF
	XWD	PROG,0			;DEVIAD
	XWD	PROG,0			;DEVOAD
	XP	ACTBTS,.-ZZ		;BREAK TABLE
	-1
	777700,,37600
	374000
	XP	ACTMOD,.-ZZ		;END OF TABLE AND SPECIAL BITS
	7,,600000
	XP	TTYPTR,.-ZZ		;TTYPTR
	Z
	XP	TTIBUF,.-ZZ
	XP	TTICHR,STTIBF*4		;9 BIT CHARACTERS FOR INPUT
	XWD	TTICHR,TTYLST+TIBF-1
	XP	TIPUTR,.-ZZ
	1100,,TTYLST+TIBF
	XP	TIPCTR,.-ZZ
	1
	XP	TITAKR,.-ZZ
	1100,,TTYLST+TIBF
	XP	TITCTR,.-ZZ
	1
	XP	TIFCTR,.-ZZ
	TTICHR
	XP	TISYNC,.-ZZ
	Z
	XP	TTOBUF,.-ZZ
	XP	TTOCHR,STTOBF*5		;7 BIT OUTPUT
	XWD	TTOCHR,TTYLST+TOBF-1
	XP	TOPUTR,.-ZZ
	700,,TTYLST+TOBF
	XP	TOPCTR,.-ZZ
	1
	XP	TOTAKR,.-ZZ
	700,,TTYLST+TOBF
	XP	TOTCTR,.-ZZ
	1
	XP	TOFCTR,.-ZZ
	TTOCHR
	XP	PTYPTR,.-ZZ
	Z
	XP	SAVDDB,.-ZZ		;FOR FILES COMMAND
	Z
	XP	IMLHAC,.-ZZ		;BITS 34:35 HOLD IMLAC BUCKY BITS.
	Z
	XP	TIBF,.-ZZ
	BLOCK	STTIBF			;THE ACTUAL INPUT BUFFER
	XP	TOBF,.-ZZ
	BLOCK	STTOBF			;THE ACTUAL OUTPUT BUFFER
;NO. OF CHAR. IN MON. BUF.
	XP	SCNDDS,.-ZZ		;SIZE OF SCN DDB
↑LINSAV: 0
↑LINSV1: 0
↑↑TTYLOK:	0
↑DKBCHR:	0
GLOBAL TTPLEN
	0	;LINTAB(-1) FOR DDBSRC
↑LINTAB: BLOCK TTPLEN
GLOBAL PTYNUM
↑PTYJOB:	BLOCK PTYNUM

BEND SCNDDB
;DIALER DATA AREA
BEGIN DILDAT

;AC SAVE LOCS
↑DILLIN:	0
↑DILTAC:	0
↑DILJ:		0

;THIS PART ZEROED AT DILINI
↑DILZBG←←.
↑DILJOB:	BLOCK DILNUM	;JOB # OF JOB OWNING THIS DIALER
↑DILCNI:	BLOCK DILNUM	;LAST CONI BITS FROM DILINT
↑DILIDS:	BLOCK DILNUM	;DILINT DISPATCH ADDRESS
↑DILZND←←.-1

BEND DILDAT
BEGIN MTCDDB  --  DEVICE DATA BLOCK FOR MAG TAPES.
SUBTTL MTCDDB - J. SAUTER, STANFORD, MAG. TAPE DEVICE DATA BLOCKS


GLOBAL SCNDDB
LINK←SCNDDB

DEFINE CAT6'(A,B),<SIXBIT /A'B/>

DEFINE MTCDDX(UNIT),<
	REPEAT DDBSKW-1,<0>	;SKEW-ZEROS
	DEVLUP,,0
	ZZ←.
IFE UNIT,<↑MTCDDB←.>
	CAT6(MTA,\UNIT)
	XWD	=60*HUNGST,MTSIZ+1+<UNIT>⊗PUNITP
	0
	XWD LINK,MTCDSP
	LINK←.-4
	XWD DVMTA!DVIN!DVOUT!DVLNG,154403
	0
	0
	XWD PROG,0
	XWD PROG,0
↑MTCENT←.-ZZ
	0	;ERROR COUNT FOR THIS UNIT:
			;0-8 = LOGN. P.E.
			;9-17 = LAT. P.E.
			;18-26 = ILL OP.
			;27-35 = DATA MISSED.
↑MTCBKN←.-ZZ
	0	;RECORD COUNTER
>
	UNIT←MTCNUM-1
; THE FOLLOWING IS XLIST'ED OUT FOR YOUR READING CONVENIENCE
; IT ACTUALLY LOOKS LIKE THIS:
; REPEAT MTCNUM,<MTCDDX(UNIT)
;       UNIT←UNIT-1>
XLIST
	REPEAT MTCNUM,<MTCDDX(UNIT)
	UNIT←UNIT-1>
LIST

;TEMP CELLS AND CONTROL DATA
↑MTEOFF:	0	;EOF FLAG
↑MTDEV:		0	;XWD COMMAND,DDB ADDR
↑MTDCCN:	0	;BLKO/BLKI POINTER FOR REDO
↑DCWRD:		0	;BLKO/BLKI POINTER FOR DC
MTCSAV:		0	;DC COMMAND
↑MISSED:	0	;-1 IF DC HAS PARTIAL WORD
↑MTERCN:	0	;ERROR COUNTER
↑MTREWN:	0	;UNITS REWINDING AND IN IOW -1=NONE, 0=ONE
↑MTCMDP:	0	;DUMP COMMAND LIST POINTER
↑SVCNTR:	0	;DUMP COMMAND IOWD NEG. WORD COUNT
↑MDCSAV:	0
↑MTIDSP:	0	;ADDRESS TO TRANSFER TO ON NEXT MAG TAPE INTERRUPT

↑MTDCND:	0	;JSR HERE WHEN BLKO/BLKI COUNTED OUT
		JRST MTDCN1

	BEND MTCDDB
BEGIN SPWDAT -- DATA FOR SPACEWAR
SUBTTL SPWDAT - JAM, STANFORD, 7-NOV-68, DATA FOR SPACEWAR SERVICE


↑SPWA:	BLOCK 20	; P1 ACCUMULATORS
↑SPWB:	BLOCK 20	; P2 ACCUMULATORS
↑SPWSAC:BLOCK 20	; USER'S ACCUMULATORS
↑SP2SAC:BLOCK 20
	0		; JOB NUMBER OF JOB WHICH HAS 
			; PDP-6 SPACEWAR ASSIGNED.
↑SPWBUT:
	0		; SPACEWAR BUTTONS
↑SPWACT:
	0		; FLAG MEANING A SPACEWAR JOB EXISTS
↑SPWCSC:
	BLOCK PSYNCN	; SPACEWAR 2-PROCESSOR SYNCHRONIZATION CELLS

;WARNING! DON'T CHANGE POSITION OF SPWGO,SP2GO,JBTST2 - SEE SPWINI - REG
↑SPWGO:	BLOCK	JOBN	
↑SP2GO:	BLOCK	JOBN
↑JBTST2:BLOCK	JOBN

	BEND SPWDAT
;SCHEDULER DATA AREA . . .
BEGIN SCHDAT
SUBTTL	SCHDAT 11 SEPT 67 SCHEDULER DATA AREA

;SCHEDU DATA


↑SCHMQT:	QQMQT
↑JOBQUE:	BLOCK JOBN	; MINUS THE QUEUE NUMBER THE JOB IS IN
; TABLES FOR JOB PRIORITY CALCULATIONS

↑SCHBEG:			;HERE TO SCHEND ZEROED BY NXTINI
↑JLCYET:	0
↑JLFACTOR:	0		;JLFACTOR/JLTIME = USEFUL PROCESSOR LEVEL
↑RJLFACTOR:	0		;RECIPROCAL JLFACTOR
↑OINTIME:	0		;HERE WE SAVE INTIME+P1PID FROM LAST JLCAL CYCLE
↑OUTIME:	0		;HERE WE SAVE UPTIME+P1PID FROM LAST JLCAL CYCLE
↑JLRIT:		0		;RECENT INTERUPT FRACTION *1000
↑ORDYET:	0
↑JBTPRI:	BLOCK JOBN	; JOB'S PRIORITY
↑JBTNPR:	BLOCK JOBN	; JOB'S NEW PRIORITY
↑JBTJL:		BLOCK JOBN	; POINTER TO FS TABLE OF INSTANTANEOUS JOB LOAD
↑JBTJLH:	BLOCK JOBN	; OLDEST JOB LOADING.
↑SCHEND←←.-1

↑GCBITS:	BLOCK 2		;BIT TABLE FOR GCMCK ROUTINE

; QUEUE TABLES . . .
		BLOCK MXQUE
↑JBTQ:		BLOCK JOBN

IFN FTSWAP,<
; SWAPPER TABLES . . .

↑SWPJMX:	0
↑SWPMXP:	0
↑SWPLMX:	0
↑SWPLMJ:	0
↑JBTSWP:	BLOCK JOBN
↑JB2SWP:	BLOCK JOBN	;LH LIKE JBTSWP FOR SPARE COPY OF SEGMENTS
				;30-35 DATA DISC CHANNEL LIST. 18-29 AVAILABLE.
;LEAVE NEXT LOCS IN ORDER FOR WHO
↑BIGHOL:	0		;CURRENT BIGGEST HOLE IN CORE (1K BLOCKS)
↑FINISH:	0		;FINISH,FORCE,FIT AND XPANDF ARE FLAGS IN SWAP
↑FORCE:		0		; NUMBER OF THE JOB THAT WILL GO OUT NEXT
↑FIT:		0		; NUMBER OF THE JOB THAT WILL COME IN NEXT
↑XPANDF:	0
↑FULCNT:	0		;PRINT DISK IS FULL EVERY 30 SECONDS
↑SEGWAIT:	0		; NUMBER OF JOB WAITING FOR UPPER SEGMENT
↑MAXSIZ:	0		;SIZE OF LARGEST JOB WHICH MIGHT BE SWAPPED OUT
↑MAXJBN:	0		;NUMBER OF THAT JOB
↑MAXRSZ:	0		; SIZE OF LARGEST RUNNABLE JOB
↑MAXRJB:	0		; JOB NUMBER OF LARGEST RUNNABLE JOB.
↑MAXSSZ:	0		; SIZE OF LARGEST SEGMENT.
↑MAXSJB:	0		; JOB NUMBER OF LARGEST SEGMENT.
↑SUMCOR:	0		; THE SWAPPER TOTALS THE CORE SIZES OF THE JOBS
				; IT IS CONSIDERING FOR SWAPOUT AND PUTS THAT TOTAL HERE
↑NEEDED:	0		;THE AMOUNT NEEDED TO SWAP JOB IN FIT IN
>

;SHARABLE DEVICE JUST BECOME AVAILABLE(EXTENDED TO OTHER QUEUES TOO)
;APPROPRIATE ENTRY IS SET NON-ZERO WHEN SCHEDULER SHOULD LOOK
;AT THAT QUEUE TO FIND A JOB TO RUN
;WSAVAL CONTAINS THE NO. OF JOBS WITH IO WAIT SATISFIED(0=NONE)

DEFINE X!(A)
<
↑A!AVAL:	0
>

↑AVALTB:	QUEUES		;GENERATE THE AVAL FLAGS
;SHARABLE DEVICE REQUEST TABLE(GENERALIZED FOR OTHER QUEUES TOO)
;CONTAINS THE NUMBER OF JOB WAITING TO USE SHARBLE DEVICE
;WSREQ AND RNREQ ARE UNUSED

DEFINE X!(A)
<↑A!REQ:	0
>


↑REQTAB:	QUEUES	;GENERATE REQ TABLE

;WORDS USED TO "REMEMBER" JOB NUMBERS
;BITS 35--9 CORRESPOND TO JOB NO'S 1--27


↑QJOB:	BLOCK JOBN	;Q TRANSFERS AT OTHER THAN CLOCK LEVEL
IFN FTSWAP,<
↑XJOB:	BLOCK JOBN	;CORE EXPANSION BY SWAPOUT-IN
>

;DATA AND STORAGE AREA USED FOR SWAPPING.  ON THE LIBRASCOPE
;   DISK, BANDS 1-15 ARE USED FOR SWAPPING, EACH BAND
;   CONTAINING 76K WORDS.

↑SQREQ:	0			;C(LH)=NEG. OF SIZE OF READ/WRITE
				;C(RH)=LOC. OF FIRST WORD TO READ/WRITE
↑SERA:	0			;SIGN IS 1 IF A READ
				;C(RH)=BLOCK NUMBER BEFORE READING,
				;    ERROR BITS AFTER READING.
↑SWPCNT:	0		;SWAPPER COUNTER.  WHEN LEQ 0, RESET TO
				;INITIAL VALUE AND RUN SWAPPER.
↑SERACT:	0			;COUNTER FOR ERRORS
↑CORMX:		0			; MAXIMUM CORE AVAILABLE TO LOSERS
↑ISONE:		0			; BOOLEAN SAYING THERE IS A JOB WHICH CAN FIT IN WITH THIS UPPER

XP CONVMD,3
	;CONVERSION FROM 1K CORE BLOCKS TO DISK BLOCKS
	;(SHIFT COUNT)
	BEND SCHDAT
SUBTTL	DATA AREA FOR CORE MANAGEMENT SYSTEM
;	 - JAM 8-24-69		- REG 2-24-72

RMEMSI:	0		;FIRST PHYSICAL NXM ADDRESS
MEMSIZ:	0		;LOGICAL NXM FOR SYSTEM = FREE STORAGE LOCATION
CORCSC:	BLOCK	PSYNCN	;P2 CAN PLAY WITH CORE CELLS!
CORBEG←←.		;HERE TO COREND ZEROED BY CORINI
FSBPT:	0		;BYTE POINTER TO 2ND BYTE IN CORTAB
CORBLK←←=256		;THE MAXIMUM NUMBER OF K WE MIGHT HAVE
CORTAB:	BLOCK 101	;9 BITS PER K OF MEMORY
CORLST:	0		;BYTE POINTER TO 2 ND BIT OF NXM IN CORTAB
CORTAL:	0		;THE NUMBER OF 1K HOLES IN CORE
IFN FTSWAP,<
CORMAX:	0		;LARGEST POSSIBLE JOBREL
>
SHFWAT:	0		;# OF JOB WAITING TO BE SHUFFLED
HOLEF:	0		;ADDRESS OF 1ST HOLE IN CORE
CORE2P:	0		;POINTER TO LAST BYTE OF SYSTEM IN CORTAB
COREND←←.-1		;END OF AREA ZEROED BY CORINI
↓%SWPL←←=196*2000	;SWAPPING LIMIT - MAX JOB SIZE
SWAPLI:	%SWPL		;CORE CELL WITH SWAPPING LIMIT SET.
↓JBTPLN←←136		;SIZE OF JOB PDL HELD IN FREE STORAGE.
			;SOME OF THE JOBPDL IS RESERVED FOR JOBDATA AREA

LOCKNO:	0		;JOB NUMBER OF USER OF THE LOCK UUO.
LOKPOS:	0		;PROT,,REL WE DESIRE FOR JOB IN LOCKNO.
LOKTOP:	0		;BOTTOM OF USER CORE.
SUBTTL	FREE STORAGE PARAMETERS
IFN FTSWAP,<FSNINIT←←1;>FSNINIT←←5	;NUMBER OF K TO CLAIM INITIALY
TSHF←←3			;COARSENESS OF FREE STORAGE (EXPONENT OF 2)
↓TRIVIAL←←1⊗TSHF	;SIZE OF MINIMUM BLOCK
NFSB←←20		;NUMBER OF DISTINGUISHABLE BLOCK SIZES
FSBEG←←.		;ADDRESS TO ZERO AT FSINI
FSCSC:	BLOCK	PSYNCN	;SYNCHRONIZATION CELLS FOR FS
FSCNT:	0		;COUNT OF PEOPLE WAITING FOR F.S.
FSLIST:	BLOCK	JOBN	;AND THEIR JOB NUMBERS
JBTPDL:	BLOCK	JOBN	;PDL POINTER FOR UUO PDL FOR EACH JOB
FSCLKF:	0		;FLAG TO THE SWAPPER THAT FS IS EXPANDING
FSGVKF:	0		;FLAG TO SAY LOOK FOR A K TO GIVE BACK
FSRTL:	0		;LIST OF BLOCKS TO BE RETURNED
FSNEWK:	0		;SET TO -1 WHEN MERGING IN A NEW 1K CHUNK
FSCKCT:	0		;COUNT TICKS UNTIL COMPUTING CHECKERBOARDING
FSBUSY:	0		;AMOUNT OF FS THAT'S IN USE RIGHT NOW.
FSAVB:	BLOCK	2*NFSB	;BASES FOR LISTS OF FREE BLOCKS
FSRPQ:	BLOCK	NFSB	;COUNT OF FS REQUESTS BY SIZE
FSBLUZ:0		;COUNT NUMBER OF TIME FSBUSY IS FUCKED UP.
FSNCLK:	0		;SET WHEN YOU NEED FSCLK CALLED.
			;OR OF FSRTL,FSCLKF, AND FSGVKF
FSIPTR:	FSLIST		;POINTER TO ADD JOBS TO FSLIST
FSOPTR:	FSLIST		;POINTER TO TAKE JOBS FROM FSLIST
FSHUNG:	0		;SET TO -1 TO INDICATE A DISASTER.
FSGTUF:	0		;FLAG FOR SPECIAL FSGET
SPFSNT:	0		;TOTAL # SPARES NEEDED
FSEND←←.-1		;END OF BLOCK ZEROED BY FSINI
;SPARE LIST CONTROL BLOCKS
;FORMAT OF SPARE LIST HEADER

		;WD0 LIST HEADER
SFSIZE←←1	;B0 AVOID REG FS, 1-8 # TO KEEP, RH SIZE
SFLINK←←2	;HEADER LINK (BOTH WAYS)
SPFSN←←3	;# SPARES CURRENTLY NEEDED
SFLOSS←←4	;LH TYPE (TEXT) RH LOSS COUNT

SFNWT←←200000	;PREVENTS WAITING AT UUO LEVEL

NSPLN←←3	;# SPARES OF STUFF ALLOC PER LINE

SFHEAD:	DPYFS,,DDFS	;THE HEADER HEADER

DDFS:	0		;DD Q BLOCKS
	400000+NDDSPQ⊗9,,QLENGT
	TTYFS
	0
	[ASCIZ /DATA DISK QUEUE/],,

TTYFS:	0		;TTY DDBS
	NSPLN⊗9,,SCNDDS+DDBSKW+1
	DDFS,,DHFS
	0
	0

DHFS:	0		;DPY HEADERS
	NSPLN⊗9,,DPYLEN
	TTYFS,,LPFS
	0
	0

LPFS:	0		;LINE PNTR TABLES
	NSPLN⊗9,,=80
	DHFS,,PPFS
	0
	0

PPFS:	0		;PAGE PRINTER INITIAL BLOCKS
	NSPLN*2⊗9,,BLKSIZ	;2 OF THESE PER PP
	LPFS,,DPYFS
	0
	0

DPYFS:	0		;RANDOM DPYSER DATA
	BLKSIZ
	PPFS,,
	0
	0
BEGIN TVDDB -- TV CAMERA DEVICE DATA BLOCK
SUBTTL TVDDB - J. SAUTER, STANFOR, 25-FEB-68, TV CAMERA DEVICE DATA BLOCK



	REPEAT DDBSKW-1,<0>	; EXTRA STANDARD DDB WORDS
	DEVLUP,,0
↑TVDDB:	SIXBIT /TV/
	XWD =2*HUNGST,0
	0		;TVIOS, NOT USED.
IFE ELFNUM <XWD	DTCDDB,TVDSP>
IFN ELFNUM <XWD ELFDDB,TVDSP>
	XWD DVTV!DVIN!DVLNG,100000
	0
	0
	XWD PROG,0
	XWD PROG,0
	0
	0
	0		;DEVACC
	0		;DEVCNT
	0		;DEVBLK
	0		;DEVBKO
	0		;DSKBUF
	0		;DSKCNT
	0		;SETCNT


	BEND TVDDB
IFN ELFNUM <SUBTTL ELFDDB - PDP-11 BARE MACHINE MODE
BEGIN ELFDDB - 7 MAY 74 BO

REPEAT DDBSKW-1,<0>
		DEVIBF!DEVLUP,,0	;It sort of has an internal buffer
↑ELFDDB←.				;(at least, it doesn't set IOACT).
		SIXBIT /ELF/
		0
		0
		XWD DTCDDB,ELFDSP
		XWD DVOUT+DVIN+DVLNG,140000	;Dump mode only for now.
		0
		0
		XWD PROG,0
		XWD PROG,0
↑ELFLOC←.
		0			;ELFSER defines its variables
		0			;in terms of ELFLOC.
		0
		0

BEND ELFDDB
↓ELFDDB←ELFDDB
↓ELFLOC←ELFLOC
>;IFN ELFNUM
BEGIN ADDDB -- DEVICE DATA BLOCK FOR A/D AND D/A.
SUBTTL ADDDB - J. SAUTER, STANFORD, 25-FEB-68, AD DEVICE DATA BLOCK
	REPEAT DDBSKW-1,<0>	; EXTRA DDB WORDS
		DEVLUP,,0
↑ADDDB:		SIXBIT /AD/
		XWD =24*HUNGST,0
		0		;ADIOS
		XWD	ADCDDB,ADDSP
		XWD DVOUT+DVIN+DVLNG,140000	;FLUSH MODE 15 8/7/73
		0
		0
		XWD PROG,0
		0
↑ADLOC1:	0
↑ADLOC2:	0
↑ADLOC3:	0
↑ADLOC4:	0
↑ADBKO:		0
↑ADERR:		0
↑ADADV:		0
↑ADBLK:		0
↑ADACT:		0
↑ADBKX:	0
↑ADJSR:	0
↑ADJSRL:	0

↑AD2INT:  0
	EXCH TAC,ADBKO
	EXCH TAC,ADADV
	JUMPL TAC,CONT
	MOVE TAC,AD2INT	;MAKE IT LOOK LIKE THE INTERRUPT WENT OFF ON
	MOVEM TAC,@ADJSR		;THE NORMAL CHANNELL.
	MOVE TAC,ADBKO
	JRST ADINT
CONT:	EXCH TAC,ADBKO
	JRST 12,@AD2INT


	BEND ADDDB
BEGIN ADCDDB - NEW AD/DA CONVERTER - (JAM 2-5-74)
SUBTTL ADCDDB - DEVICE DATA BLOCK FOR NEW AD/DA CONVERTER

	REPEAT DDBSKW-1,<0>
	DEVLUP,,ADCCSC
↑ADCDDB:SIXBIT /ADC/		; ANALOG-DIGITAL. INPUT ONLY.
	77*HUNGST,,0
↑ADCIOS:0
	DACDDB,,ADCDSP
	DVIN!DVLNG,,140000
	0
	0
	0
	0
↑ADCCSC:BLOCK PSYNCN
↑ADCZB:		; BEGINNING OF BLOCK TO ZERO AT INITIALIZE TIME
↑ADCBKI:0	; CURRENT IOWD
↑ADCNBK:0	; NEXT IOWD
↑ADCRCB:0	; STARTUP IOWD FOR RECYCLE MODE
↑ADCTHR:0	; THRESHHOLD FOR RECYCLE MODE
↑ADCCNO:0	; CONO WORD TO START UP
↑ADCERA:PROG,,0	; ADDRESS OF PLACE IN USER CORE TO PUT ERROR CODES
↑ADCRUN:PROG,,0	; ADDRESS OF USER CORE WD TO 'SETOM' WHILE ADC RUNNING
↑ADCRCW:PROG,,0	; ADDRESS OF USER CORE WD TO PUT RECYCLE IOWD WHEN DONE
↑ADCP1L:0	; P1'S SYNC LOCATION
↑ADCP2L:0	; P2'S SYNC LOCATION
↑ADCSTI:0	; STRAY ADC INTERRUPTS
↑ADCWPS:0	; WORDS PER SECOND AT THIS CLOCK RATE AND PACKING
↑ADCZND:	; END OF BLOCK TO ZERO

↑ADCTAC:0	; SAVED ACCUMULATOR FOR I-LEVEL (MUSN'T ZERO THIS!)
↑ADCNOH:0	; WHEN ≠0, INHIBITS HUNG TIMEOUT


	REPEAT DDBSKW-1,<0>
	DEVLUP,,DACCSC
↑DACDDB:SIXBIT /DAC/
	77*HUNGST,,0
↑DACIOS:IO,,0
	TVDDB,,DACDSP
	DVOUT!DVLNG,,140000
	0
	0
	0
	0
↑DACCSC:BLOCK PSYNCN
↑DACZB:		; BEGINNING OF BLOCK TO ZERO AT INITIALIZE TIME
↑DACBKO:0	; CURRENT IOWD
↑DACNBK:0	; NEXT IOWD
↑DACCNO:0	; CONO WORD TO START UP
↑DACERA:PROG,,0	; ADDRESS OF USER CORE WD TO PUT ERROR CODES
↑DACRUN:PROG,,0	; ADDRESS OF USER CORE WD TO `SETOM' WHILE DAC RUNNING
↑DACP1L:0	; P1'S SYNC LOCATION
↑DACP2L:0	; P2'S SYNC LOCATION
↑DACSTI:0	; STRAY DAC INTERRUPTS
↑DACWPS:0	; WORDS PER SECOND AT THIS CLOCK RATE AND PACKING
↑DACZND:	; END OF BLOCK TO ZERO

BEND ADCDDB
BEGIN APRDAT	↔	SUBTTL	APRDAT 7 NOV 68	APRSER DATA
IFN FTBAT,<
↑BATYET:	=10*JIFSEC		;START AFTER 10 SECONDS
↑BATPNT:	0			;POINTER INTO BATMAN, ROBIN AND BATFLG

;ZERO IN EITHER BATMAN OR ROBIN MEANS NO RUN!
↑BATMAN:	'[ONCE]'	;SYSTEM STARTUP HELPER
		'*SPY* '	;ACCOUNTING
		'[LIST]'	;NEW SPOOLER
		'[XSPL]'	;XGP SPOOLER
		'*-SL-*'	;SERVICE LEVEL MONITOR
		'[-NS-]'	;NEWS SERVICE (AP)
		'<RMND>'	;REMINDER FANTOM
IFN IMPSW,<	'LOGGER'	; IMP MESSAGE SWITCHER  >
IFN FTHG, <	'*-HG-*'	;STATISTIC GATHERER	>
		'PONYSY'	;PRANCING PONY BILLING SYSTEM
		0		;1 PATCH SPACE
↑BATLEN←←.-BATMAN

↑ROBIN:		'  1  2'	;SYSTEM STARTUP HELPER, (HEAVY)
		'ACTSYS'	;ADDRESS OF THIS GUY
		'SPLSYS'	;NEW SPOOLER
		'SPLSYS'	;XGP SPOOLER
		' SLSYS'	;LOC OF SL MONITOR
		' NSSYS'	;NEWS SERVICE (AP)
		'RMDSYS'	;REMINDER
IFN IMPSW,<	'NETSYS' >
IFN FTHG, <	' HGSYS'	;STATISTICS PROPRIETOR	>
		'PNYSYS'	;PRANCING PONY SYSTEM
		0		;PATCH AREA

;ALFRED, THE FAITHFUL BUTLER.
↑ALFRED:	BLOCK	BATLEN	;SPACE FOR TIME REQUESTS

;POLICE COMMISSIONER GORDON MEMORIAL TABLE (PLEASE REMOVE YOUR FEET)
;PRIVILEGES FOR PHANTOMS
↑GORDON:	PRIPRV!DEVPRV!LUPPRV,,0	;SYS STARTER CAN DO ANYTHING!
		MESPRV!LUPPRV,,0	;SPY (NEEDS MES FOR AUTOLOGOUT)
		REAPRV!MESPRV!LUPPRV,,0	;LPT SPOOLER
		REAPRV!MESPRV!LUPPRV,,0	;XGP SPOOLER
		SSLPRV!LUPPRV,,0	;SERVICE LEVEL SYSTEM
		REAPRV!LUPPRV,,0	;NEWS SERVICE (AP)
		LUPPRV,,0		;REMINDER
IFN IMPSW,<	0			;LOGGER		>
IFN FTHG, <	ACWPRV!LUPPRV,,0	;HE DIDDLES HGYET	>
		LUPPRV,,0		;PRANCING PONY SYSTEM
		0			;PATCH AREA
>;END OF FTBAT


↑ONCEI:		JSR ONCE
↑SYSTHERE:	0			;-1 => SYSTEM IS ON THE L'SCOPE DISK

↑DAMESS:	ASCIZ /-JAN-/
↑DISMON:	ASCIZ /-JAN-/		;RPH FOR DISDATE
↑MONPTR:	0
↑FIXBUF:	BLOCK FIXLEN
↑ERRYET:	-1

IFN FTSHF1K,<
↑SHFTAC:	0
↑SHFEND:	0
↑SHFJOB:	0
↑SHFBLK:	0
>

↑TIMDAT:	0		;<DATE>,,<TIME IN SECS>
↑INITIM:	0		;AS TIMDAT, TIME OF LAST RELOAD/RE-INITIALIZATION.

; BEGINNING 2-PROCESSOR SPLIT DATA AREAS

↑P1DATA:
↑SPWUUF:	0		;SET WHEN SPACEWAR IS ACTIVE
↑SPWTMO:	0		;SPACEWAR TIMEOUT COUNT
↑SPWBLO:	0		;LOCATION OF BLOWN UP SPACEWAR JOB
↑SPWXCT:	0		;CONTAINS JRST 2,@UUO0 OR SOMETHING ELSE
↑INTACT:	0
↑INTNF:		0
↑INTACS:	BLOCK 20
↑INTSAC:	BLOCK 20
↑INTDISP:	0
↑INTSP:		0
↑INTREQ:	0
↑INTQUANT:	0
↑CLKSV:		CLKSAVE
↑CLKESV:	CLKESAVE
↑...TMP:	0
↑APRTAC:	0
↑APRAC1:	0
↑APRAC2:	0
↑APRJ:		0
↑APRCN:		APRCON
↑APRIN1:	0
↑APRIN2:	0
↑APRIN3:	0
↑APRID:		P1PID
↑APRCH:		APRCHL
↑APRERR:	0		;APR ERROR BITS ON NON-EX MEM, ETC.
				;SET BY APRSER, CLEARED BY CLK ROUTINE(CLOCK)
↑APRPC:		0		;PC WHEN APR ERROR DETECTED
↑APRPLN←←140
↑APRPDL:	IOWD APRPLN,APRPD
↑APRPD:		BLOCK APRPLN
↑ERRPLN←←200
↑ERRPD:		IOWD ERRPLN,ERRPDL
↑ERRPDL:	BLOCK ERRPLN
↑DSFLAG:	0
↑JOB:		0
↑SJOB:		0
↑JOBDAT:
↑JOBADR:	0
↑LASTPR:	0
↑USRREL:	0

;LOCATIONS COPIED FROM JOB DATA AREA INTO MONITOR WHEN A JOB RUNS
;THIS PREVENTS THE USER FROM CLOBBERING THEM AND MAKES IT
;EASIER FOR THE MONITOR TO LOCATE THESE QUANTITIES WHEN IT
;NEEDS TO FOR THE CURRENT JOB
;CONTENTS ARE COPIED BACK WHEN JOB BECOMES INACTIVE(SEE CLOCK)
;COMPARE WITH JOB DATA AREA(SEE JOBDAT)

↑USRPRT:			;FIRST LOC. OF PROTECTED JOB DATA
↑USRHCU:	0		;HIGHEST USER IO CHANNEL IN USE
				;0 MEANS EITHER NONE OR CHAN. 0 IN USE
				;NEG, MEANS SAVE-GET HAS ACTIVE IO EVEN THOUGH USRJDA
				;TABLE IS OVERWRITTEN BY GET.
				;RH=ADR. OF SAVE-GET DEVICE(USED BY ANY ACT ROUT. IN
				;IN CORE SHUFFLER
				;ONLY CHAN. ASSIGNMENTS IN USE ARE COPIED INTO
				;MONITOR WHEN JOB RUNS
↑USRPC:		0		;JOB PC WHEN SCHEDULER IS CALLED
↑USRDDT:	0		;RH=STARTING ADR. OF USER DDT,LH UNUSED
↑USRJDA:	BLOCK	20	;RH=JOB DEVICE ASSIGNMENTS (DEVICE DATA BLOCK ADDRESSES)
				;LH=UUOS DONE SO FAR FOR THIS CHANNEL(SEE SYSPAR)
				;0 MEANS NO DEVICE INITIALIZED ON THIS CHANNEL
↑USRLO←←USRJDA
				; FIRST LOC CLEARED BY SETUSR ROUTINE
				;ON A CALL [SIXBIT /RESET/]
				;ALSO CLEARS USRHCU
↑USRLO1←←USRLO+1		; FIRST LOC+1
↑USRHI←←.-1			; FIRST LOC CLEARED BY SETUSR

↑CHKYET:	0
↑UUO0:		0
		JRST UUO1
↑UUO2:		0	;JSR HERE FOR OPCODES 100-127
		JRST UUO3
↑UUOLOC:	0
↑CLOCK:		POINT 36,CIPWT-1,35
↑MONSUM:	0
↑NULDAT:	BLOCK 140
↑PALIVE:	0
↑NULBAD:	0
↑CIPWT:		BLOCK 2*JOBN
↑USRSAV:	0		;TEMPORARY FOR UUO HANDLER(IMPURE ROUTINE!)
↑CLKFLG:	0		;NON-ZERO WHEN CLK INTERRUPT FORCED FOR ANY REASON
↑CLKS17:	0
↑USAVPC:	0		; SAVED PC ON ILM TRAPS
↑CLKPDL:	BLOCK CLKPLN
↑CLKCH:		CLKCHL
↑OTHERID:	0		; CONTAINS THE OTHER PROCESSOR'S IDENTIFICATION
↑TIMEFF:	0
↑TIMEF:		0		;NON-ZERO FOR CLOCK INTERRUPT ON APR
				;SET BY APRSER, TESTED AND CLEARED BY CLK ROUTINE
↑TIME:		0		; TIME OF DAY IN TICKS SINCE MIDNIGHT
↑THSDAT:	0		;TODAY'S DATE((Y-1964)*12+M-1))*31+(D-1)
↑UPTIME:	0
↑INTIME:	0
↑SCHEDF:	0		;FORCED RESCHEDULING FLAG FOR CLK ROUTINE
				;USED TO FORCE RESCHEDULING WHEN JOB IS IN EXEC MODE
↑UUOXIT:	JEN @UUO0	;UUO EXIT INST, SOMETIMES CONO PI,PIOFF (SEE USRXIT CODE)
↑UUOXI:		JEN @UUO0	;BACKUP COPY FOR RESTORING ABOVE
↑INTHLD:	0		;FLAG TO DISABLE INTNOW (SEE USRXIT)

↑PDATALEN←←.-P1DATA

↑P2DATA:
		BLOCK PDATALEN

↑P1PID←←0
↑P2PID←←PDATALEN
↑SYSBEG←←.		;HERE TO SYSEND ZEROED AT RELOAD OR INITIALIZATION
;	↑AFOOL:		0	;PART OF APRIL 1 HACK
↑UUO.SA:	BLOCK 20	;HACK TO SAVE AC'S AT THE VERY LAST UUO.
↑...TAC:	0
↑LASTDI:	0	;LAST DISASTER TIME
↑LASTRE:	0	;LAST RESTART TIME
↑SHFWRD:	0	;TOTAL COUNT OF WORDS SHUFFLED BY SYSTEM
↑COMCNT:	0	;# OF COMMANDS TYPED-IN BUT NOT DECODED.
			;SET BY SCNSER, DECREMENTED BY COMCON
↑HNGTIM:	0	;HUNG DEVICE TIME COUNT CHECK FOR HUNG IO
			;DEVICES WHEN THIS GOES TO ZERO (ONCE A SECOND)
↑STUSER:	0	;JOB CURRENTLY USING THE SYSTEM TAPE
			;NEEDED SO CONTROL C WILL NOT TIE UP SYSTEM TAPE

↑APRLST:	0		; CLOCK INTERRUPT LIST
↑ESTINT:	0		; -1 → GOT INTO CH7 FROM ESTOP WITH INTACT SET
↑JBTSTS:	BLOCK	JOBN	;JOB STATUS BITS
REPEAT 0,<
↑JB2STS:	BLOCK	JOBN	;TWO PROCESSOR INTERLOCKED STATUS BITS
↑JBTOWN:	BLOCK	JOBN	; WHAT PROCESSOR OWNS WHICH JOB
↑JBTCSC:	BLOCK	PSYNCN
>
↑PDLCSC:	BLOCK	PSYNCN	; PDL SETUP INTERLOCK
↑JBTDVW:	BLOCK	JOBN	; DDB ADDRESS OF DEVICE THIS JOB WAITS FOR
↑JBTGSL:	BLOCK	JOBN	; JOB'S GUARANTEED SERVICE LEVEL
↑NJOBS:		BLOCK	JOBN	; NUMBER OF JOBS POINTING TO THIS SEGMENT
↑CJOBS:		BLOCK	JOBN	; COUNT DOWN TABLE FOR SCHEDU
↑UUOPC:		BLOCK	JOBN	; THIS IS WHERE THE UUO-LEVEL PC IS STORED
↑UUOOPC:	BLOCK	JOBN	; THIS IS WHERE THE UUO PC ONE BACK IS SAVED
↑JBTUPC:	BLOCK	JOBN	; SAVE UUO-LEVEL PC HERE FOR DEBREAK
↑JBTADR:
↑JBTDAT:	BLOCK	JOBN
↑JBTPR2:	BLOCK	JOBN	;PEEK-POKE TABLE
↑JBTLIN:	BLOCK	JOBN	;TTY LINE NO. OF JOB. (=-1 IF DETACHED.)
IFN FTLOGIN,<
↑JBTPRV:	BLOCK	JOBN	;JOB ACTIVE PRIVELEGE BITS
↑JB2PRV:	BLOCK	JOBN	;JOB PASSIVE PRIVELEGE BITS
↑JBTTPV:	BLOCK	JOBN	;JOB TEMPORARY PRIVILEGE BITS
↑PRJPRG:	BLOCK	JOBN	;PROJECT PROGRAMMER NAME OF JOB OWNER
IFN FTDSKPPN,<
↑DSKPPN:	BLOCK	JOBN	;DISK ALIAS PPN
>;FTDSKPPN
↑SLRMAX←←20			;MAXIMUM NUMBER OF SL RESERVATIONS
↑SLCOST:	0		;=0,1,2 DEPENDS ON TIME OF DAY,TIME OF WEEK
↑SLNRES:	0		;NUMBER OF SL RESERVATIONS
↑SLRES:		BLOCK	SLRMAX	;TABLE OF SL RESERVATIONS
>
↑JOBNAM:	BLOCK	JOBN	;NAME OF CURRENT PROGRAM (FOR WHO)
↑JBTKCJ:	BLOCK	JOBN	;KILO CORE JIFFIES USED BY THIS JOB
↑JBTBTM:	BLOCK	JOBN	;LOGIN TIME FOR A JOB
↑JOBPPN:	BLOCK	JOBN	; DIRECTORY CURRENT PGM CALLED FROM
↑JOBCRD:	BLOCK	JOBN	;PROGRAM'S CREATION DATE (FROM FILE RETRIEVAL)
IFN FTDISK,<
↑JBTUFD:	BLOCK	JOBN	;LOGICAL ADDR OF USER'S UFD.
↑CUSLOC:	0		;SAME OF [1,3] UFD.
>
↑JOBDEV:	BLOCK	JOBN	; DEVICE THAT JOB WAS CALLED IN FROM
↑JOBLOG:	BLOCK	JOBN	; LOGICAL DEVICE NAME
↑RTIME:		BLOCK	JOBN	; RUN TIME AT LAST "TIME" COMMAND
↑TTIME:		BLOCK	JOBN	;TOTAL RUN TIME
↑FTIME:		BLOCK	JOBN	;<DATE>,,<TIME IN SECS> WHEN JOB LAST RUN
↑XTIME:		BLOCK	JOBN	;RUN TIME WHEN LAST ACTIVATED OUT OF TTY INPUT WAIT
↑JBTWAT:	BLOCK	JOBN	; TIME WAITING FOR SYSTEM (NOT IN IOWQ OR STOPQ)
↑JB2WAT:	BLOCK	JOBN	; RECENTLY SAVED VALUE OF JBTWAT (FOR WHO LINE)
↑JBTRNB:	BLOCK	JOBN	;CPU TIME USED SINCE JOB'S LAST PRIORITY CALCULATION
IFN FTSWAP,<
↑STIME:		BLOCK	JOBN	; SET TO -1 WHEN CORE IMAGE IS MODIFIED
>
GLOBAL TTPLEN
IFN FTTTYBUG,<	↑TTCBCK:	BLOCK	3	>;TEMP FOR COMCNT BUG TRAP
↑ASTAB:		BLOCK	DDNUM+DPYNUM	;MAPPING TABLE FOR AUDIO SWITCH
↑ASBTAB:	BLOCK	DDNUM+DPYNUM	;BEEP DURATION
↑PAGNOW:	0		;-1 => PAGING NOW
↑TTYTAB:	BLOCK	TTPLEN
↑TPYTAB:	BLOCK	PTYNUM
↑PTYTAB:	BLOCK	PTYNUM
↑CRKYET:	0
↑RSTBEG←←.			;THIS AREA CLEARED ON RESTARTS
IFN FTDISK,<
↑JBTIOP:	BLOCK	JOBN	;IO PUSH/POP POINTERS
>
↑JBTSIN:	BLOCK	JOBN	;SWAPIN LIST FOR COMMAND DECODER, INTS, ETC.
↑SAVSAI:	BLOCK	JOBN
↑JBTDTS:	BLOCK	JOBN	; LIST OF SEGMENTS THIS JOB HAS DETACHED
↑JBTGLU:	BLOCK	JOBN	;NON-ZERO GLUES JOB IN PLACE IN CORE.
↑JBTFS:		BLOCK	JOBN	; TEMPORARY FREE STORAGE
↑JBTMAIL:	BLOCK	JOBN	;PTR. TO LETTER ADDRESSED TO JOB.
↑JBTTCR:	BLOCK JOBN	;PNTR TO TMPCOR FILES
↑JBTMSK:	BLOCK	JOBN	;NEW STYLE INTERRUPT SYSTEM MASKS
↑JBTIEN:	BLOCK	JOBN	; INTERRUPT ENABLINGS
↑JBTIRQ:	BLOCK	JOBN	; REQUESTS PENDING
↑JBTWKM:	BLOCK	JOBN	; TELLS WHICH BITS CAUSE WAKEUP
↑JBTIIP:	BLOCK	JOBN	; INTERRUPT IN PROGRESS
↑INTDTM:	BLOCK	JOBN	; DATUM OF INTERUPT
↑UUOPTR:	BLOCK JOBN	;PNTR TO UUO SIMULATOR TABLE
↑RSTEND←←.			;END OF AREA CLEARED ON RESTARTS
IFN FTSTAT, <
↑STATS:		BLOCK	STATLEN	; STATISTICS GATHERING SERVICE
↑STATNUM:	0		; NUMBER OF TIMES WE'VE WRAPPED AROUND
>
↑JOBNM1:	0		; MAXIMUM JOB NUMBER

; WHO LINE DATA STORAGE

↑LASTUP:	0		; NEGATIVE UPTIME WHEN SYSTEM WHO LINE LAST DONE
↑LASTNL:	0		; RECENT VALUE OF NEGATIVE RUN TIME FOR NULL JOB
↑JBSRUN:	BLOCK	2	; BITS FOR JOBS THAT HAVE BEEN RUN LATELY
↑WHONXT:	0		; NUMBER OF THE III WHOSE WHO LINE WAS DONE LAST
↑WHDDNX:	0		; NUMBER OF NEXT DATA DISK CHANNEL TO GET WHO LINE
↑WHOPTR:	0		; POINTER TO THE DD THAT WAS DONE LAST (SEE DPYSER&WHOQUE)
↑WHODAT:	0		; DATE ON CURRENT WHO LINE
↑FREWAT:	0		; FREE STORAGE RELEASE WAIT LIST
↑FRETAB:	BLOCK DPYNUM+DDNUM ; FREE STORAGE POINTER FOR EACH WHO LINE
↑T15CNT:	0		;COUNT FOR 1/4 TH SECOND CLOCK
↑DKBCNT:	0		;WHEN THIS GOES NEGATIVE, DKB HARDWARE
				;  IS CHECKED (CODE IS IN CLKSER).
↑NDDXOL:	0		;OLD VALUE OF NDDXCT
↑NDDLOL:	0		;OLD VALUE OF NDDLCT
↑NDSTAT:	0		;COUNTS DOWN TO RUN FROB IN 5 SECONDS.
↑SYSEND←←.
IFN FTSTAT,<
↑STATPTR:	POINT 18,STATS	; BYTE POINTER TO STATISTICS TABLE
>
↑AUTOSYNC:	0
↑SYSTOP:	0		;FIRST LOCATION USED BY USER PROGRAMS.

;;ADDRESS BREAK CRAP . . .
↑BRKMAX←←20			; MAXIMUM NUMBER OF LEGAL PCS
↑BRKTAC:	0
↑BRKAC1:	0
↑BRKNUM:	0		; CURRENT NUMBER OF LEGAL PCS
↑BRKTAB:	BLOCK BRKMAX	; PUT GOOD PCS HERE

; DISASTER MESSAGE BUFFERS AND STUFF

↑DISLEN←←400
↑DISBUF:	BLOCK	DISLEN
↑DISPTR:	POINT	7,DISBUF
↑DISOPT:	POINT	7,DISBUF
↑DISFLAG:	0
↑DISCTR:	5*DISLEN

; ACCUMULATOR SAVE ROUTINE FOR CLKING

↑CLKSAVE:
	0
	SKIPN 17,JOBDAT+P1PID	; CURRENT JOB DATA AREA
	MOVEI 17,NULDAT+P1PID	; NO, USE NULL JOB'S
	MOVEM 16,JOBD16(17)
	MOVEI 16,JOBDAC(17)
	BLT 16,JOBD15(17)
	MOVE TAC,CLKS17
	MOVEM TAC,JOBD17(17)
	MOVE PID,[P1PID]
	JRST @CLKSAVE

↑CL2SAVE:
	0
	SKIPN 17,JOBDAT+P2PID	; CURRENT JOB DATA AREA
	MOVEI 17,NULDAT+P2PID	; NO, USE NULL JOB'S
	MOVEM 16,JOBD16(17)
	MOVEI 16,JOBDAC(17)
	BLT 16,JOBD15(17)
	MOVE TAC,CLKS17
	MOVEM TAC,JOBD17(17)
	MOVE PID,[P2PID]
	JRST @CL2SAVE

↑CLKESAVE:
	0
	HRRZ 17,JOBADR+P1PID
	ADDI 17,JOBDAC
	MOVEM 16,16(17)
	HRRZI 16,15(17)
	BLT 17,(16)
	MOVE PID,[P1PID]
	JRST CLKES1

↑CL2ESAVE:
	0
	HRRZ 17,JOBADR+P2PID
	ADDI 17,JOBDAC
	MOVEM 16,16(17)
	HRRZI 16,15(17)
	BLT 17,(16)
	MOVE PID,[P2PID]
CLKES1:	MOVE TAC,CLKS17(PID)
	MOVE PROG,JOBDAT(PID)
	MOVEM TAC,JOBD17(PROG)
	MOVE J,JOB(PID)
	SKIPN TAC,USAVPC(PID)
	MOVE TAC,@CLKCH(PID)
	SETZM USAVPC(PID)
	TLNN TAC,USRMOD		; IS PC IN EXEC?
	JRST CLKES2		; YES, CAN'T SAVE HIS PC.
	MOVEM TAC,JOBPC(PROG)
	CAMN J,SJOB(PID)
	MOVEM TAC,USRPC(PID)
CLKES2:	MOVE P,INTSP
	MOVE TAC,@CLKESV(PID)
	JRST @TAC


	BEND APRDAT
;	DATA AREA FOR PARITY SERVICE
PARBLK:	0			;SET BY CORE ROUTINES - OLD LOC OF SHUFFLED JOB
PARSJB:	0			;SAVE JOB NUMBER OF JOB BEING SHUFFLED.
PARSJN:	0			;FLAG WITH JOB NUMBER OF SHUFFLED JOB.
PARFLG:	0			;SET BY P2 WHEN IT HAS ERROR
P2RFLG:	0			;SET BY P1 WHEN IT SEES PARFLG
P2SA:	0			;PLACE FOR P2RINT TO SAVE AN AC
ERRLOC:	-1			;IF > 0 THEN LAST LOC SEEN WITH BAD PARITY
RERLOC:	0			;RELATIVE ERROR LOCATION.
PARPSA:	0			;SAVE P HERE WHILE WE USE APRPDL
ERRPC:	-1			;PC AT TIME OF ERROR

SYSERR:	0			;LEFT SIDE = -1 WHEN PARITY ERROR IS FOUND
				;IN THE SYSTEM (OR INDETERMINATE)
				;RIGHT SIDE = APR CONI BITS TO PRESERVE 
				;STATE OF SYS WR REF KLUGE.

LASLOS:	0			;SET TO JOB NUMBER OF LAST JOB THAT LOST
ERRJOB:	BLOCK	2		;BIT TABLE OF JOBS THAT HAVE LOST DURING
				;THIS PASS THROUGH CORE.

; STATISTICS COUNTERS
;  CAUTION:  THE RELATIVE ORDER OF THESE COUNTERS SHOULD NOT BE CHANGED,
;    BECAUSE THE PROGRAM MONUSE THINKS IT KNOWS WHERE THINGS ARE

IFN FTHG, <	XWD HGXMAX,HGNMAX;STBEG-2 CONTAINS # OF EACH KIND OF HG CNTR
		HGCNTS	;LOCATION STBEG-1 POINTS TO HISTOGRAM COUNTERS!  >
STBEG←←.
NCORCALLS:	0	; NUMBER OF CALLS ON THE CORE ROUTINES
NFSGETS:	0	; NUMBER OF TIMES FREE STORAGE IS GOTTEN
NFSGIVES:	0	; NUMBER OF TIMES FREE STORAGE IS RELEASED
NCOMS:		0	; NUMBER OF COMMANDS THAT HAVE BEEN DISPATCHED TO
NDLYCMS:	0	; NUMBER OF COMMANDS THAT HAVE BEEN DELAYED
NUUOS:		0	; NUMBER OF UUOS
NSCHEDS:	0	; NUMBER OF TIMES WE HAVE ENTERED THE JOB SCHEDULING LOOP
NQXFERS:	0	; NUMBER OF QUEUE TRANSFERS
NOUTSWPS:	0	; NUMBER OF SWAPOUTS - 10
NINSWPS:	0	; NUMBER OF SWAPINS
NDDQUE:		0	; NUMBER OF TASKS CREATED FOR THE DATA DISC QUEUE
NNUUOS:		0	; NUMBER OF NEW UUO DISPATCHES
NFSWAITS:	0	; NUMBER OF TIMES WE HAD TO WAIT FOR FREE STORAGE
NFSLP1:		0	; NUMBER OF LOOPS (TYPE 1) IN FSGET
NNULLJS:	0	; NUMBER OF SCHEDULINGS THAT CHOSE THE NULL JOB
NJSWITCHES:	0	; NUMBER OF TIMES JOBS WERE SWITCHED
NWSCHEDS:	0	; NUMBER OF TIMES JOBS TURN THEMSELVES OFF - 20
NTMOS:		0	; NUMBER OF TIMES JOBS GET TIMED OUT
NJRNULLS:	0	; NUMBER OF TIMES A JOB IS RUNNABLE WHILE THE NULL JOB IS RUNNING
NPWAITS:	0	; NUMBER OF FAILURES IN SYNCHRONIZATION
NLERRS:		0	; NUMBER OF TIMES THROUGH FININ1 WITH ERRORS
NSAERR:		0	; NUMBER OF TIMES THROUGH FININ1 WITH SUCCESS AFTER ERROR RETRIES
NLREQS:		0	; NUMBER OF TRANSFERS
NLRERS:		0	; NUMBER OF TRANSFERS PLUS NUMBER OF ERROR RETRIES
NFSGFA:		0	;NUMBER OF FAILURES FROM FSGET - 30
NABFE:		0	; NUMBER OF TIMES WE ADVANCED AN OUTPUT BUFFER
NABFF:		0	; NUMBER OF TIMES WE ADVANCED AN INPUT BUFFER
NFSLP2:		0	;NUMBER OF LOOPS (TYPE 2) IN FSGET
NPUSHD:		0	;MAXIMUM PUSH DOWN DEPTH USED IN A UUO PDL.
NDDFRM:		0	; NUMBER OF FRAMES CREATED FOR THE DATA DISC QUEUE
NDDLCT:		0	;-(NUMBER OF LINES SENT TO DD)
NDDLMX:		0	;MAX COUNT FOR 5 SECONDS
NDDXCT:		0	;NUMBER OF ENTRIES MADE TO DD QUEUE.-40
NDDXMX:		0	;MAX COUNT FOR 5 SECONDS
NDDL1C:		0	;COUNT OF 1 AND 2 LINE TRANSFERS TO DD.
↑NIOTS:		0	;HOW MANY NEW UUOS (700-777) HAVE BEEN CALLED
↑NSCALL:	0	;HOW MANY STANFORD CALLIS HAVE BEEN CALLED
STEND2 ←← .-1		;END OF STATISTICS SECTION (FOR *SPY*)
IFN FTHG, <
HGNMAX ←← 40		;NUMBER OF HISTOGRAM COUNTERS
HGXMAX ←← 1		;NUMBER OF "EXTRA" COUNTERS
HGSET:		0	;RESET VALUE FOR HGYET
HGYET:		0
HGCNTS:	BLOCK	HGNMAX	;HISTOGRAM COUNTERS - INCREMENTED IN HG ROUTINE
	BLOCK	HGXMAX	;EXTRA COUNTERS - NOT INCREMENTED IN HG ROUTINE
HGCH2 ← .-1		;CH2 (DISK XFER) ACTIVE TIME (AN "EXTRA" COUNTER)
HGCH6:		0	;NUMBER OF TIMES CH5 ENTERED WITH CH6 ACTIVE
			;IF HGCH6 ISN'T INCREMENTED, THEN ONE OF NEXT 4 IS:
HGSYS:		0	;# OF OCCURRENCES OF ¬(USRMOD) ∧  (CH7 ACTIVE)
HGUSR:		0	;# OF OCCURRENCES OF  (USRMOD) ∧ ¬(CH7 ACTIVE)
HGUUO:		0	;# OF OCCURRENCES OF ¬(USRMOD) ∧ ¬(CH7 ACTIVE)
HGSPW:		0	;# OF OCCURRENCES OF  (USRMOD) ∧  (CH7 ACTIVE)
HGNULL:		0	;NUMBER OF TIMES NULL JOB RUNNING ∧ ∃ JOB WAITING
HGIDLE:		0	;NUMBER OF TIMES NULL JOB RUNNING W/ EMPTY RUNQ
HGCODE:		0	;VARIOUS CLKINT SUBROUTINES SET THIS VARIOUSLY
	>
STEND←←.-1		;END OF STATISTICS SECTION